Tag Info

New answers tagged

2

You can generate the conditions that should go inside Which on the fly. holes[x_, y_, radius_, holefraction_] := Which @@ Flatten[{ Table[ {Norm[{xp - x, yp - y}] <= radius, holefraction}, {xp, 0, 10}, {yp, 0, 10} ], True, 1 }]; Test: DensityPlot[ holes[x, y, 0.3, 0.5], {x, 0, 10}, {y, 0, 10}, PlotPoints -> ...


1

myBlock = ImplicitRegion[RegionMember[Cuboid[], {x, y, z}], {x, y, z}]; myHole[xcenter_, ycenter_, radius_, depth_] := ImplicitRegion[ RegionMember[ Cylinder[{{xcenter, ycenter, 1.05}, {xcenter, ycenter, 1 - depth}}, radius], {x, y, z}], {x, y, z}]; RegionPlot3D[ RegionDifference[myBlock, RegionUnion[ Table[myHole[x, y, .06, .3], {x, .2, .8, .2}, ...


5

PeriodicHole[p : {x_, y_}, radius_, holefraction_, per : {xPer_, yPer_}] := If[Norm[p - Round[p, per]] < radius, holefraction, 1] Plot3D[PeriodicHole[{x, y}, .2, .1, {.5, .4}], {x, 0, 1}, {y, 0, 1}, PlotPoints -> 50, MeshFunctions -> {#3 &}, PlotStyle -> Directive[Orange, Specularity[White, 20]]]



Top 50 recent answers are included