Ive made a module to expand a list by reflections and translations. Here is the block.
makeBZ001[x_] := Block[{rt1, , rt2, rt3, dat = x, temp1, temp2, temp3, rm, tempfull,
full, rtt, res},
rt1 = ReflectionTransform[{1, -1}];
temp1 = dat;
temp1[[All, ;; 2]] = rt1[temp1[[All, ;; 2]]];
rt2 = ReflectionTransform[{1, 0}];
temp2 = DeleteDuplicates[Join[dat, temp1]];
temp2[[All, ;; 2]] = rt2[temp2[[All, ;; 2]]];
rt3 = ReflectionTransform[{0, -1}];
temp3 = DeleteDuplicates[Join[dat, temp1, temp2]];
temp3[[All, ;; 2]] = rt3[temp3[[All, ;; 2]]];
tempfull = DeleteDuplicates[Join[dat, temp1, temp2, temp3]];
rm = RegionMember[Polygon[{{0.0, 1.0}, {1.0, 0.0}, {0.0, -1.0}, {-1.0, 0.0}}]];
full = Pick[tempfull, rm[tempfull[[All, ;; 2]]]];
rtt = RotationTransform[\[Pi]/180 45];
res = full;
res[[All, ;; 2]] = rtt[res[[All, ;; 2]]];
res
]
Now, I've tested the code without the Block
and it works as expected, no problems. However, when I call it after making a block it causes the kernel to crash.
test = makeBZ001[data];
Any ideas about whats causing this issue?
Vesion is (*11.3.0 for Microsoft Windows (64-bit) (March 7, 2018)*)
Here is an example of the data: sampledata
After the data runs through all the procedures and its plotted it looks like this,
Edit I've tried the code on my desktop and it runs fine, seems to be some sort of issue with the memory, Im guessing.
$Version
is when it comes to questions of the kind. On my machine ("11.2.0 for Microsoft Windows (64-bit) (September 11, 2017)"
) there is no crash whenRandomReal[1, {5, 3}]
is supplied as input. $\endgroup$Pick
command. I even switch the order to make all reflections and rotations firsts, and this works well. However it crashes when doingPick
in the last step. $\endgroup$data = Import["j11.csv"]
, thenmakeBZ001[data];
, will crash the kernel? I.e., it beeps, the notebook doesn't change, and the In[...] counter resets to 1? I can't reproduce that in M11.3 / macOS 10.13. $\endgroup$