7

I cannot run the CylinderMesh function of MeshTools in Mathematica version 12.3.1.

$Version
(*Install MeshTools*)
ResourceFunction["GitHubInstall"]["c3m-labs", "MeshTools"];
(*Load MeshTools package*)
Needs["MeshTools`"]
mesh = CylinderMesh[{6, 4}]
(* "12.3.1 for Microsoft Windows (64-bit) (June 19, 2021)" *)
(* $Failed *)

Error

Can anybody reproduce the error or suggest what might be wrong with the code?

Update

After some investigation, I discovered that the problematic function call is in FindGeometricTransform. The following shows the automatic determination of the transformation class for FindGeometricTransform fails for a simple 3D translation.

FindGeometricTransform[{{0, 0, -1}, {0, 0, 1}}, {{0, 0, 
   0}, {0, 0, 2}}]
(* FindGeometricTransform[{{0, 0, -1}, {0, 0, 1}}, {{0, 0, 
   0}, {0, 0, 2}}] *)

Find geometric transform error

One can remedy the problem by explicitly defining transformation class like so:

FindGeometricTransform[{{0, 0, -1}, {0, 0, 1}}, {{0, 0, 0}, {0, 0, 
   2}}, TransformationClass -> "Translation"]

Successful find geometric transformation

@user21 filed this as a bug report as indicated in his comment to his answer. I also submitted a support request [CASE:4846569].

Tim Laska
  • 16,346
  • 1
  • 34
  • 58

1 Answers1

6

I don't know what is going on in the package, but here is a workaround:

mesh = DiskMesh[5];
mesh["Wireframe"]

enter image description here

ExtrudeMesh[mesh, 1, 5]["Wireframe"]

enter image description here

user21
  • 39,710
  • 8
  • 110
  • 167
  • 3
    Thank you very much. It is a short/sweet workaround. I did a little digging and found that FindGeometricTransform[{{0, 0, -1}, {0, 0, 1}}, {{0, 0, 0}, {0, 0, 2}}] fails. One has to explicitly set the transformation class like so FindGeometricTransform[{{0, 0, -1}, {0, 0, 1}}, {{0, 0, 0}, {0, 0, 2}}, TransformationClass -> "Translation"]. I would expect the Automatic methods should be able to do a better job on the TransformationClass. Do you agree? – Tim Laska Aug 03 '21 at 19:40
  • @TimLaska Yes, this is a bug, I believe, and I filed it as such. It worked in 12.2. – user21 Aug 04 '21 at 10:37
  • Thank you very much! I submitted a support case last night too, but I suspect yours may carry more weight ;). – Tim Laska Aug 04 '21 at 13:26