5 – An update on outputting results in Ansys Mechanical: 3D Result Objects

Categories:

This post is the fifth of six and it is about creating results objects that can be viewed in 3D by people who don’t own Ansys Mechanical. You can use the Ansys Viewer, 3D PDF, make rendering files, and display on a web page. Using the Ansys viewer is simple and 3D PDF requires a plugin. For rendering or web viewing, it is not a direct shot, but with the help of EnSight and a few open-source tools, you can share complex 3D results with a lot of people.

Using the Ansys Viewer format and Ansys Viewer

Ansys solves the problem of sharing 3D results across their product line with people who don’t have Ansys through the Ansys Viewer. It is free, simple to use, and should be used in most situations. Right now you can export results from Ansys CFX, CFD-Post (for CFX or Fluent results), TurboGrid, and Ansys Mechanical to this format.

You can download the viewer here.

Making the file is very simple. Just Right-Mouse-Button on the object you want to share. Then select Export > Ansys Result Viewer

image 90

Then open this file in Ansys viewer and view away. We have not had any problems with customers of all skill levels use this tool.

image 91

For most real engineering situations, you should stop here. This is a robust way to share 3D result objects with anyone, and they don’t need a license of Ansys. But if you need more, including higher-quality 3D objects, keep going.

What about 3D PDF?

If you want to use 3D PDF, there is a plugin for this on the Ansys app store. One of the European channel partners, 7tech, has created More-PDF. Note, it is not free. Free to download and try, but there is a cost. It works in Ansys Mechanical as a plugin and has a stand-alone version that works with CFD Pre/Post, Electronics Desktop, or MAPDL. I won’t get into how to install or use it because the help files that come with are outstanding.

Here is a sample Ansys result that they have provided. You can view it in Acrobat Reader, it won’t render in 3D on a web browser.

image 92

Making a Generic 3D File: PLY

If you read the article on making high-quality images, you saw that Ansys Ensight is a very powerful tool. One thing it does is support a bunch of different 3D file formats. One of those formats is a PLY file, which is a great intermediate format for so much more.

Get started by following the instructions in the previous article about high-quality images using EnSight. But instead of exporting to an image, we are going to save as PLY.

When you have the result you want, go to File > Export > Geomtric Entities.

image 93

In the dialog, chose PLY Polygonal File Format. This will be our generic format we can convert into many different things (including 3D printer files, discussed in the next article.) Make sure you specify which times or modes you want. By default, it will make a PLY for each one.

image 94

You can now take that PLY file into any fancy rendering program. If you want to show your results in the middle of a rendered scene of something else, the PLY file is the file to use.

I downloaded the opensource tool Blender and gave it a try. The user interface in these tools is nothing like CAD or CAE tools, so it took me a while to get something useful. I think Keyshot Pro would be a better tool for those who don’t know “artist” tools like Blender.

If you do want to give it a try, you can get your color contours by clicking on the object after you import it, then click on the material icon and choose Surface, then set Surface to Specular, Base Color to Vertex Color | Color, and make sure the specular color is dark or black.

One could spend hours (days) learning a rendering tool and playing with surface reflection and transparency. But if you need something high quality for the marketing team, pass them a PLY file and let their graphic artists do their thing.

Here is the file to help if you do want to dig in yourself.

3D Web Results with X3D (and what happened to VRML?)

Early in the days of the web, there were a lot of people that saw the platform as a way to share and interact with three-dimensional virtual space. They create the Virtual Reality Modeling Language, VRML, as a way to represent 3D objects using triangles with detailed information on each triangle about color, texture, transparency, and shininess. It is fundamentally a file format that represents what your graphics card needs to do 3D graphics but in a common format. The fact that simulation results are basically the same thing made it a nice fit for sharing results, geometry, and meshes with other people.

It was pretty cool and you can still save Ansys information in VRML from various programs. But the viewers were clunky and were focused on the virtual reality experience and not showing 3D objects. It also never really took off because you needed a VRML viewer to see the object. That was always a pain.

As it drifted out of favor, an organization replaced it with a new, better format and a JavaScript viewer that would get loaded automatically: the result, X3D graphics.

Here is the result. Click on the impeller and spin away. Here are some basic commands:

Spin: Left Mouse Button
Pan: Middle Mouse Button
Zoom: Scroll Wheel

Reset: r
Show all: a

Are you sure you want to do this?

Now that I’ve gotten you excited about doing this, let me scare you. This is not for the faint of heart. You need to use an Ansys Mechanical APDL result file in Ansys Ensight to make the file. Then you need to do some HTML/CSS. If you are comfortable with going down that path, read on.

The obvious question is, “when will Ansys add these file formates to the Export capability?” Right now you can only export 3D results to a deformed STL (not color info) and the Ansys in-house Ansys Viewer Format, *.avz.

Getting an X3D from PLY

Now we need MeshLab. There are many other tools the read PLY files and output to other formats, but MeshLab has not let me down yet. It is opensource, does everything, and is a pain to use. You will laugh at the user interface. But if you want 3D objects on your website (or to 3D Print results) this is the best path. You can download MeshLab from www.meshlab.net. Once you have it installed, follow these steps:

  • Open MeshLab
  • Chose File > Import Mesh
  • Spin it around, look at it. You could scale and transform. But we just want to convert it.
  • Chose File > Export Mesh As
  • Scroll down in the File of Type dropdown and pick X3D File Format (*.x3d)
image 95
  • Save
  • Make sure you have onlly Color checked for Vert. Then click OK
image 96

Now we are really close… but not really. We have a X3D file.

Here are both the PLY and X3D files:

I hosted the x3d file on our web server as well.

Here is where the HTML/CSS happens. And explaining that is way beyond this post. Here is the code to show the solution of mode 35 of our impeller, as shown above:

<script src="https://x3dom.org/release/x3dom.js"></script>

<link rel="stylesheet" href="https://x3dom.org/release/x3dom.css" />
<style>
#imp1 {
    background: #000;
    border: 1px solid orange;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
}
</style>
<x3d id="imp1" x="10px" y="10px" width="400px" height="400px" >
  <scene render="true">
    <environment id="myEnv" ssao="true" ssaoamount="0.5" 
	ssaoblurdepthtreshold="1.0" ssaoradius="0.4" 
	ssaorandomtexturesize="8" sorttrans="true" 
	gammacorrectiondefault="linear" tonemapping="none" 
	frustumculling="true" smallfeaturethreshold="1" 
	lowprioritythreshold="1" minframerate="1" 
	maxframerate="62.5" userdatafactor="-1" 
	smallfeaturefactor="-1" 
	occlusionvisibilityfactor="-1" 
	lowpriorityfactor="-1" 
	tessellationerrorfactor="-1">
    </environment>
    <SpotLight id='spot' on ="TRUE" beamWidth='0.9' 
	color='0 0 1' cutOffAngle='0.78' 
	location='0 0 12' radius='22' > 
    </SpotLight>
    <NavigationInfo id="head" headlight='true' type='"EXAMINE"'>      
    </NavigationInfo>
    <Transform translation = '0 0 -2'>
      <inline 
	url="https://www.padtinc.com/downloads/i1-m35-3d-a.x3d"> 
      </inline>
    </transform>
  </scene>
</x3d>

The above code works for our example and has a smattering of options available to make your image show the way you want it. There are hundreds more. If the code makes sense to you, use the documentation at x3dom.org to do more. If it looks like gobly-gook, find someone who can help you or buckle down and learn. It’s not hard, just different for us simulation types.

Some Tough Talk about 3D Results

The truth of the matter is that Ansys Mechanical is great for looking at 3D Results in Mechanical or in the Ansys Viewer. It is not set up to support other 3D file formats. And there is a reason for that. Do you really need to have a 3D PDF? Is having a 3D result on your website just cool, or do you really need it?

The fact is, for most projects, you need a 2D image of your key results in your report. Most of the fancy 3D viewable is to help people who don’t have Ansys understand results better. Or you need it for marketing. For the first case, just use the Ansys viewer. For the second, it can be a bit of work but you can create some eye-catching geometry.

However, one advantage of having a 3D result object is that you can convert it into something you can 3D print. And that is the subject of our next, and final post on this topic: “6 – An update on outputting results in Ansys Mechanical: 3D Printing Results.

Categories

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Additive Manufacturing Success.

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

03/27/2024

2024 Arizona Space Summit

03/28/2024

SAF Blue Carpet Event

03/28/2024

2024 Arizona Space Summit

04/03/2024

Low Frequency Updates in Ansys 2024 R1 - Webinar

04/03/2024

Venture Madness Conference Reception + Expo

04/03/2024

Stratasys F3300: Game Changing Throughput - Webinar

04/08/2024

39th Space Symposium

04/09/2024

39th Space Symposium

04/10/2024

Discovery Updates in Ansys 2024 R1 - Webinar

04/10/2024

39th Space Symposium

04/11/2024

39th Space Symposium

04/22/2024

Experience Stratasys Truck Tour: Houston, TX

04/24/2024

Structures Updates in Ansys 2024 R1 (2)

04/24/2024

Experience Stratasys Truck Tour: Houston, TX

05/07/2024

Experience Stratasys Truck Tour: Albuquerque, NM

05/08/2024

Fluent Materials Processing Updates in Ansys 2024 R1 - Webinar

05/09/2024

Experience Stratasys Truck Tour: Los Alamos, NM

05/14/2024

Simulation World 2024

05/15/2024

Simulation World 2024

05/16/2024

Simulation World 2024

05/22/2024

Optics Updates in Ansys 2024 R1 - Webinar

06/12/2024

Connect Updates in Ansys 2024 R1 - Webinar

06/26/2024

Structures Updates in Ansys 2024 R1 (3) - Webinar

06/27/2024

E-Mobility and Clean Energy Summit

07/10/2024

Fluids Updates in Ansys 2024 R1 - Webinar

08/05/2024

2024 CEO Leadership Retreat

10/23/2024

PADT30 | Nerdtoberfest 2024

Search in PADT site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: