with(plots): a,b,c:=0.5,0.5,1: Rs:=1:#1.7: eqSphere:=(x-a)^2+(y-b)^2+(z-c)^2-Rs^2: sphpara:=(u,v) -> expand([a,b,c]+Rs*[sin(v)*cos(u),sin(v)*sin(u),cos(v)]): Rcyl:=0.5: eqcyl:=x^2+y^2-Rcyl^2: eqcone:=x^2+y^2-z^2: p:=3: g:=80: #===== différence cone moins sphère ======= #min(min(eqSphere),min(eqcone)) ou min(eqSphere,op(eqcone)) ou max(-eqSphere,-eqcone) ou min(eqSphere,eqcone) display( [implicitplot3d( min(eqSphere,-eqcone),x=-p..p,y=-p..p,z=-p/4..2*p,grid=[g,g,g],style=patchnogrid,color=cyan) ,plot3d(sphpara(u,v),u=0..2*Pi,v=0..Pi,style=line,thickness=1) ],scaling=constrained,axes=none,orientation=[-140,70,170], view=[-p/2..p,-p/2..p,-p/2..p]) ; #===== intersection cone - sphère ======= ## max(-eqcone,eqSphere) ou min(-eqSphere,eqcone) ou min(-eqSphere,op(eqcone)) ou max(eqSphere,-op(eqcone)) p:=3: g:=100: display( [implicitplot3d( min(eqSphere,eqcone),x=-p..p,y=-p..p,z=-p/4..2*p,grid=[g,g,g],style=patchnogrid,color=cyan) ,plot3d(sphpara(u,v),u=0..2*Pi,v=0..Pi,style=line,thickness=1) ],scaling=constrained,axes=none,orientation=[-140,70,170], view=[-p/2..p,-p/2..p,-p/2..2*Rs]); #===== différence sphère moins dodéca ======= p:=2: ## min(-min(eqSphere),-min(eqcone)) ou max(min(eqSphere),min(eqcone)) display( [implicitplot3d(min(-eqSphere,eqcone),x=0 .. 2*p,y=0 ..2*p,z=0 .. 2*p,grid=[g,g,g],style=patchnogrid,color=cyan) ,plot3d(sphpara(u,v),u=0..2*Pi,v=0..Pi,style=line,thickness=1) ],scaling=constrained,axes=none, view=[-p/2..p,-p/2..p,-p/2..2*Rs]); #===== réunion sphère-dodéca ======= p:=1.5: eqSphere:=(x-0.5)^2+(y-0.5)^2+(z-0.5)^2-R^2: ## min( eqSphere,eqcone)ou max(-eqSphere,-eqcone) display( [implicitplot3d(min(eqSphere,eqcone), x=-p .. p,y=-p .. p,z=-p .. p,grid=[g,g,g],style=patchnogrid,color=cyan) ],scaling=constrained,axes=none,orientation=[70,70,2]); #=====sections planes d'un objet ======= p:=1.5: eqSphere:=(x)^2+(y)^2+(z)^2-Rs^2: eps:=1: plan1:=eps+x-y-z: plan2:=eps+x+y+z: display( [implicitplot3d(min(-eqSphere,plan1,plan2), x=-p .. p,y=-p .. p,z=-p .. p,grid=[g,g,g],style=patchnogrid,color=cyan) ],scaling=constrained,axes=none,orientation=[-90,45,30]);