Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - Learn all about the Community Ranking System, a fun gamification element of the PTC Community.
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Dec 26, 2022
09:36 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 26, 2022
09:36 PM

How do I export XYZ data from CreateMesh?

How do I export XYZ data from CreateMesh? I am exporting data from a Mathcad Prime 3D surface plot to a graphics program which will allow me to color code the surface based upon the Z values.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Dec 27, 2022
11:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
11:36 AM

The data structure suggested by Terry can be easily created in Prime and then exported to Excel in one go:

And you may even create the plot in Excel but it would need some more additional work to have it using a better color scheme and more meaningful scales.

7 REPLIES 7

Dec 26, 2022
10:40 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 26, 2022
10:40 PM

Which data structure is needed by the external graphics program?

CreateMesh creates a nested matrix. Its a 3 x 1 matrix and the elements are n x m matrices with the x, y and z values of the surface points. Furthermore this structure also defines automatically the quadrilateral "patches" the surface consists of.

It would be easy to write a small program to export a 3-column matrix with n * m elements consisting of all the points of the surface, but how would an external program know which four points create a side face of the surface?

So once you know the data structure needed for your external program, it may be possible to write a Mathcad program to create and export that structure.

I guess most programs won't understand the structure READPRN creates

Real Mathcad of course does:

Dec 26, 2022
11:13 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 26, 2022
11:13 PM

Real Mathcad even makes a good job if only provided a simple linear point list without any information about side faces.

In Prime:

In Mathcad

But again - you'll have to know which data structure your external program needs.

Dec 27, 2022
03:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
03:07 AM

Hi,

Export the three nested matrices in M as separate Excel files.

Most graphical packages can handle Excel files.

For example ORIGIN with a simple rearrangement in Excel gets this:

Cheers

Terry

Dec 27, 2022
11:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
11:36 AM

The data structure suggested by Terry can be easily created in Prime and then exported to Excel in one go:

And you may even create the plot in Excel but it would need some more additional work to have it using a better color scheme and more meaningful scales.

Dec 27, 2022
02:43 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
02:43 PM

Werner,

Please explain the matrix operators which have vertical and horizontal parenthesis. Thanks!

Glen

Dec 27, 2022
03:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
03:37 PM

@gatlas wrote:

Werner,

Please explain the matrix operators which have vertical and horizontal parenthesis. Thanks!

Glen

What you are referring to are the matrix row- and column selectors.

Here is in a bit more detail explained what I did:

So, if the program you use for plotting expects that kind of data table and if it can read Excel (which is very likely) this should help.

Prime 6 sheet attached

Dec 27, 2022
04:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 27, 2022
04:45 PM

I added a function which directly creates that data structure from a given function R x R -> R without the need to call CreateMesh and alter its output data.

Syntax is similar to that of CreateMesh.

BTW, the reason for the crude X and Y values is because the last two (optional) arguments of CreateMesh are the number of data values, NOT the number of intervals.

So if x runs from 10 to 30 and you ask for 10 data values you are asking for just 9 intervals. So the first value is 10 and the second is 10+(30-10)/9=12.222.... So ist probably better to ask for 11 data values to get the series 10, 12, 14, ...30.

P6 sheet attached