Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello everyone,
I'm trying to use the "rotate" function obtained from the "plottool" collection downloaded from this community some time ago. I would like to know why the "rotatemesh" function is marked in red as it is evident from the following figure, while the function "rotate" which utilizes it, doesn't give error?:
Solved! Go to Solution.
@-MFra- wrote:
Hello everyone,
I'm trying to use the "rotate" function obtained from the "plottool" collection downloaded from this community some time ago. I would like to know why the "rotatemesh" function is marked in red as it is evident from the following figure, while the function "rotate" which utilizes it, doesn't give error?:
Because rotate operates upon the whole 3D mesh (3x(BoundxBound)) whereas rotatemesh only operates upon an individual mesh (eg, x-y or z-x (BoundxBound)). Try vectorizing the rotatemesh expression in Frotate.
Stuart
Hi,
Please upload your worksheet.
@-MFra- wrote:
Hello everyone,
I'm trying to use the "rotate" function obtained from the "plottool" collection downloaded from this community some time ago. I would like to know why the "rotatemesh" function is marked in red as it is evident from the following figure, while the function "rotate" which utilizes it, doesn't give error?:
Because rotate operates upon the whole 3D mesh (3x(BoundxBound)) whereas rotatemesh only operates upon an individual mesh (eg, x-y or z-x (BoundxBound)). Try vectorizing the rotatemesh expression in Frotate.
Stuart
Thank you very much!
Nessun problema.
@StuartBruff wrote:
@-MFra- wrote:
Hello everyone,
I'm trying to use the "rotate" function obtained from the "plottool" collection downloaded from this community some time ago. I would like to know why the "rotatemesh" function is marked in red as it is evident from the following figure, while the function "rotate" which utilizes it, doesn't give error?:
Because rotate operates upon the whole 3D mesh (3x(BoundxBound)) whereas rotatemesh only operates upon an individual mesh (eg, x-y or z-x (BoundxBound)). Try vectorizing the rotatemesh expression in Frotate.
Stuart
Arrgggh! Ignore the above. That's not what's happening.
A 3D-mesh is a 3x{mxn} nested array. rotatemesh is designed to rotate a 3D-mesh.
Createmesh returns a nested 3D-mesh. In your instance, Createmesh returns a 1x1 array containing a 3D-mesh. To handle nested 3D-meshes, you should use rotate, which is designed to rotate a set of 3D-meshes. rotate will also handle a 3D-mesh and should, therefore, be used in preference to rotatemesh.
The reason vectorize works on rotatemesh(Fmesh, ...) is because the sole element of Fmesh is a 3D-mesh. If you'd written rotatemesh(Fmesh₀,...) that would have worked as well.
Apologies for the confusion. I'm going to blame my responding just after I'd woken up and not having had a cup of tea. Either that or I'm just an idiot ... ☹️
Stuart
@StuartBruff wrote:
A 3D-mesh is a 3x{mxn} nested array. rotatemesh is designed to rotate a 3D-mesh.
Createmesh returns a nested 3D-mesh. In your instance, Createmesh returns a 1x1 array containing a 3D-mesh.
Note that, for some reason or other(*), this is not the case in Prime.
CreateMesh now returns a 3D-mesh and the 3D Plot component no longer accepts a nested array of meshes. This messed up a lot of my worksheets.
M15 ...
MP7 ...
Stuart
(*) I struggle to see a technical or philosophical reason why PTC felt the need to change Prime's behaviour in this respect.
Yes, but, unfortunately, Prime's no longer capable of treating a set of related meshes as one object ... and I don't feel enamoured of the idea of typing in each and every one of the meshes to display several such objects.
I can't do the below in Prime. I have to scale & translate outside of the plot then manually input each mesh into the 3D Plot. Or, at least, AFAIA.
Unless, ... just a minute ...
Doesn't solve all the problems, but ...
where
Stuart
The graphics are not clear, that is: since Fmesh represents a surface, applying a rotation to Fmesh should produce the same surface but rotated. Instead rotatemesh produces two sections rotated at ninety degrees, why? it seems wrong to me.
@-MFra- wrote:
The graphics are not clear, that is: since Fmesh represents a surface, applying a rotation to Fmesh should produce the same surface but rotated. Instead rotatemesh produces two sections rotated at ninety degrees, why? it seems wrong to me.
Sorry, which graphics are you referring to? There's no rotation in the message you're replying to, as far as I can see.
Stuart