New answers tagged

2

It seems be a bug. By now we have to solve it manually. poly = {{-(49/10), 266/5, 43/2}, {-(89/10), 47, 43/2}, {-(54/5), 85/2, 43/2}, {-(62/5), 217/5, 43/2}, {-(88/5), 499/10, 43/2}, {-(183/10), 487/10, 43/2}, {-(211/10), 221/5, 43/2}, {-(17/10), 162/5, 43/2}, {69/10, 459/10, 43/2}, {-(22/5), 53, 43/2}}; line = {{-7, 100, 42}, {0, 15, 10}}...


6

ClipPlanes can clip the region by half-spaces a*x+b*y+d*z+d<=0. Since the normal of such hyperplane a*x+b*y+d*z+d==0 is {a,b,c}, so the hyperplane which pass through one point {x0,y0,z0} is {a,b,c}.({x,y,z}-{x0,y0,z0})=0.It means that we can set d=-{a,b,c}.{x0,y0,z0}. human = AnatomyData[Entity["AnatomicalStructure", "Skin"], "...


2

that is great, but why does it take too long time (84 sec) when adding InterpolationOrder -> 0 to ListDensityPlot? As I already demonstrated in the answer to another question of yours, using precomputed RegionMemberFunction as the value for the RegionFunction option gives huge speedup. In this particular case with InterpolationOrder -> 0: Boundrs = {{-...


9

I think you've found a bug! I think different parts of Mathematica deal with Tube differently. Note that DiscretizeRegion thinks Tube is degenerate: evaluate DiscretizeRegion[Tube[]] for an error message. This suggests to me the reason for the mixing of areas and lengths in the Area output—some kind of degeneracy. (By the way, it's not only Area that doesn't ...


5

Use pre-computed RegionMemberFunction: Module[{rf = RegionMember[region]}, ListDensityPlot[datr, ColorFunction -> (Blend[{Orange, Gray, Black}, Rescale[#, {-1, 1}]] &), InterpolationOrder -> 0, ColorFunctionScaling -> False, ClippingStyle -> Automatic, RegionFunction -> (rf[{#1, #2}] &)]] // AbsoluteTiming


5

I dont know why it takes so long. But I have a solution for you. Its sort of a hack AbsoluteTiming[Show[ListDensityPlot[datr, ColorFunction -> (Blend[{Orange, Gray, Black}, Rescale[#1, {-1, 1}]] & ), InterpolationOrder -> 0, ColorFunctionScaling -> False, ClippingStyle -> Automatic], Graphics[{White, Polygon[{{-2....


15

As kglr says, you should use RegionMember. However, instead of mapping RegionMember (which is basically what his Select code does), you should provide all the points at once to the RegionMemberFunction. For example: rmf = RegionMember[reg]; r1 = Select[rmf] @ allPoints; //AbsoluteTiming (* kglr *) r2 = Pick[allPoints, rmf[allPoints]]; //AbsoluteTiming r1 ==...


1

Boundrs = {{-(π/3), -(π/Sqrt[3])}, {-((2 π)/3), 0}, {-(π/3), π/Sqrt[3]}, {π/3, π/ Sqrt[3]}, {(2 π)/3, 0}, {π/3, -(π/Sqrt[3])}, {π/ 3, -(π/Sqrt[3])}, {-(π/3), -(π/Sqrt[3])}}; region = Polygon[Boundrs] datr = Flatten[ ParallelTable[{x, y, Sin[x y]}, {x, -3, 3, 0.1}, {y, -3, 3, 0.1}], 1]; plotTowD = ListDensityPlot[datr, ...


3

dsk = Disk[{0, Sqrt[3]}, Sqrt[3]]; reg = RegionIntersection[DiscretizeRegion@dsk, DiscretizeGraphics[ff2]]; cropped = MeshPrimitives[reg, All]; Graphics[{AbsoluteThickness[1], AbsolutePointSize[10], cropped}] Graphics[{First@ff2, AbsoluteThickness[3], AbsolutePointSize[7], MapThread[{##} &, {{ Blue, Red}, Reverse@cropped}], Opacity[.5], Green, ...


3

I suggest using patterns and deleting the unwanted Disk and Line objects. reg = Disk[{3/4, 0}, 2]; ff2 = {Table[unitCell @@ (a1 j + a2 k), {j, -5, 5}, {k, -5, 5}]}; Graphics[DeleteCases[ ff2, (Disk[{x_, y_}, r_] /; {x, y} \[NotElement] reg) | (Line[{{x1_, y1_}, {x2_, y2_}}] /; ({x1, y1} \[NotElement] reg || {x2, y2} \[NotElement] reg)), ...


Top 50 recent answers are included