Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router = 2; (*outside radius*)
- rinner = 1; (*inside radius*)
- rsmall = 0.1; (*radius of small pores*)
- nsmall = 40; (*number of small pores*)
- radii = RandomReal[{rinner + 2*rsmall, router - 2 rsmall},nsmall];(*radial position of smallpores*)
- angle1 = RandomReal[{0, 2 $Pi$},nsmall];(*angular position of small pores*)
- coords = Map[radii[[#]]*{0, Sin[angle1[[#]]], Cos[angle1[[#]]]} &,Range[nsmall]];(*coordinates of small pores*)
- hollowsphere = RegionDifference[Ball[{0, 0, 0}, 2], Ball[{0, 0, 0}, 1]];(*first region interesection*)
- smallspheres = RegionUnion[Map[Ball[coords[[#]], rsmall] &, Range[nsmall]]];(*combine small pores*)
- hollowsphereminussmallspheres = RegionDifference[hollowsphere, smallspheres] (*second region interesection*)
- r1 = ImplicitRegion[x < 0, {x, y, z}]; (*For visualization*)
- rplot = RegionIntersection[r1, hollowsphereminussmallspheres];
- RegionPlot3D[rplot, PlotPoints -> 100]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement