Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting a scalable vectorgraphic form APDL

Status
Not open for further replies.

helplessapld

Student
Oct 28, 2022
8
Hi everyone,

I'm trying to export a scalable vector graphic (the best format would be as .svg) from ANSYS APDL. The aim is to implement this graphic in a LaTeX document.
I have read some articles about that. There was discribed the following procedrue: clicking on PlotCtrls > Redirect Plots > to PSCR. But my problem is that I simply don't have the option "to PSCR". Could someone please give me a hint how to export the corrent view on the window as vector graphic?
Thanks in Advance!
Best regrads
 
Replies continue below

Recommended for you

helplessapld,

It has been an extremely long time since I have been anywhere near ANSYS. Does it generate vector graphics?

LaTeX can work with PNG and JPEG.

--
JHG
 
Per about the Postscript (PSCR) output:

Compatible Products: – | Pro | Premium | Enterprise | Ent PP | Ent Solver | DYNA

All that comes to mind is to see if there is a .OBJ (solid faceted model with color information) export as would be used with compatible 3D printers.

Other than that I'd recommend .PNG bitmap capture at 200-300 DPI for the placed image.
 
Hi drawoh,

I'm pretty sure ANSYS APDL (or Classic) can generate vector graphics, but the question is how exactly I can do it.
Thats right, LaTeX can work with raster graphics like PNG or JPEG, but my intention is to use vector graphics for the scalability itself.

I found a work around by myself just some minutes ago.
My LaTeX Code looks like this:
Code:
\begin{figure}[h]
	\begin{center}
		\begin{tikzpicture}
			\begin{axis}
				[tick style={draw=none},
				axis line style={draw=none},
				xticklabels={,,},
				yticklabels={,,},
				zticklabels={,,},
				colormap/bluered,
				width=15cm,
				height=5cm
				]
				\addplot3[surf] file {diagrams/<filename>.dat};
			\end{axis}
		\end{tikzpicture}
		\caption{<caption_text>}
		\label{<label>}
	\end{center}
\end{figure}
The called file is a .dat file and is structured like this:
Code:
0.000e+00	0.000e+00	0.000e+00
5.051e+00	0.000e+00	0.000e+00
1.010e+01	0.000e+00	0.000e+00
1.515e+01	0.000e+00	0.000e+00
2.020e+01	0.000e+00	0.000e+00
2.525e+01	0.000e+00	0.000e+00
3.028e+01	0.000e+00	0.000e+00
3.528e+01	0.000e+00	0.000e+00
4.028e+01	0.000e+00	0.000e+00
4.528e+01	0.000e+00	0.000e+00

0.000e+00	1.000e+00	0.000e+00
5.051e+00	1.000e+00	3.170e-02
1.010e+01	1.000e+00	1.056e-01
1.515e+01	1.000e+00	1.388e-01
2.020e+01	1.000e+00	4.539e-02
2.525e+01	1.000e+00	-8.707e-02
3.028e+01	1.000e+00	4.235e-03
3.528e+01	1.000e+00	3.832e-01
4.028e+01	1.000e+00	6.707e-01
4.528e+01	1.000e+00	8.224e-01

0.000e+00	2.000e+00	0.000e+00
5.051e+00	2.000e+00	9.670e-02
1.010e+01	2.000e+00	3.185e-01
1.515e+01	2.000e+00	4.476e-01
2.020e+01	2.000e+00	2.799e-01
2.525e+01	2.000e+00	5.096e-02
3.028e+01	2.000e+00	2.932e-01
3.528e+01	2.000e+00	1.135e+00
4.028e+01	2.000e+00	1.742e+00
4.528e+01	2.000e+00	2.120e+00
Where the first column is the x position, the second column is the y position and the third column is the z position.
In this case the plotted geometry is three rows wide and ten rows long.

This works very well with one exception:
When the geometry is quite large and has for example 7 thousand nodes (which isn't even close to be a big FEM Model) the memory limit of pgfplots will be exceeded. You can ask yourself the question, if you would need that much nodes, but in case of a FEM Simulation it is quite difficult to reduce the data without any visible information loss.

Therefore, if some can help me, to export a scalable vector graphic from ANSYS APDL or how to extend the memory size of pgfplot I would be very thankful.

So thanks in advance and best regards.

 
Hi 3DDave,
Thanks for your reply.
But I can't really find a reference to exporting a vector graphic, since all the file types listed in the command description refer to raster graphics.
Have I over read something there?
And thanks for your recommendation with the bitmap and the resolution of 200-300 DPI, but as you can see from my last post, it's very important to me that it's actually a vector graphic.

Thanks in advance.
Best regards!
 
What exactly is the export - it looks from that data there is a series of slices. What does that tell about the model/analysis?

 
The real (but already at the export reduced) data set is a lot bigger and has a total of round about 2500 rows. I reduced it further to show the concept without posting that much code. It shows the deformend geometry of a shell.
The point of exporting it like this in LaTeX is that, when the "slices" are equally long, a structured mesh can be generated by LaTeX. This is shown here:
example_fbpzcl.png

The picture is originally a scalable vector graphic in my LaTeX document / the output .pdf. The shown surface is as already mentioned also a reduces one, where only every fifth node is shown in the direction of the multiple buckles. My intention is to show more nodes / elements to better approximate the steep walls, like the one on the right side.
Therefore I'm still interrested in exporting the vector graphic from APDL directly or expand the memory which is available.
 
Are the colors added just based on height?

The problem I foresee is that every scalable format will be carrying a large amount of floating point representation and if you are having trouble with a point cloud, then SVG, et al, won't improve the situation.

After it's in the document can the user scale the graphics or make measurements from them?
 
The colors are added based on height, that's right.
What exactly do you mean with "trouble with a point cloud". If you mean the visuability, this won't be a problem.
The problem I have at the moment is, that LaTeX only limits the accessible memory while creating the graphic.
The user should be able to zoom in and out on the PDF but performing measurements isn't possible.
But one big advantage of the way I'm doing it right now is, that it's possibile to rotate the surface before plotting it on the PDF even after exporting if from APDL.
 
There are other graphics packages that could generate a PNG from the height field and allow rotation of the dataset. I expect Matlab, R, Mathematica, Python, and so forth, could perform this task. I am afraid I cannot offer specific help with those applications, but they are commonly used in schools, so help should be available to you.

The problem I was alluding to is that SVG will have even larger amounts of data for LaTeX to manage than the simple point cloud. If the point cloud is a problem then SVG, et al, will be a bigger problem.
 
Oh you mean a raster graphic with point cloud, now I understand. It's no problem to insert a raster graphic in my LaTeX document at all, but this is what I would like to prevent. The reasons for that are, the quality of the resulting image and the low data volume of the resulting PDF. Therefore the mentioned programms would really help.
 
No - the conversion of the larger number of real numbers in the SVG is harder than the conversion of the numbers you already have for LaTeX to handle. SVG makes the problem worse. On top of which LaTeX is going to output either a bitmap/raster version or it will output to a PDF/Postscript version which will be even larger than the original data set.


Point clouds <> raster graphics. They are two entirely different things.

Try
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor