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

To support some new marketing efforts I had to make some different types of results output from models in Ansys Mechanical:

  • A 3D plot on a webpage
    Post 5
  • A physical printout on our 3D Printer
    Post 6

All of the posts are here.

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

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.

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.

If you want to share results in PDF, this seems to be a good tool for that. I’m not sure what the pricing is for it. More information is here, including more example files.

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.

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.

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)
  • Save
  • Make sure you have onlly Color checked for Vert. Then click OK

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.

FDM printed part with surface texture added in SolidWorks 2020.

Printing 3D Texture on FDM 3D Printed Parts – it can be done!

While many examples exist of impressive texturing done on 3D printed Stratasys PolyJet printed parts (some wild examples are here), I have to admit it took me a while to learn that true texturing can also be added to Stratasys Fused Deposition Modeling (FDM) parts. This blog post will walk you through adding texture to all faces or some faces of a solid model, ready for FDM printing. You, too, may be surprised by the results.

I know that complex texturing is possible in a graphics sense with such software packages as Rhino, PhotoShop, Blender and more, but I’m going to show you what you can achieve simply by working with SolidWorks, from Rev. 2019 onwards, as an easy starting point. From there, you can follow the same basic steps but import your own texture files.

Example of Stratasys FDM part set up to print with a checkerboard surface texture. (Image courtesy PADT Inc.)
Example of Stratasys FDM part set up to print with a checkerboard surface texture. (Image courtesy PADT Inc.)

SolidWorks Texture Options

First off, let’s clarify some terms. Texture mapping has existed for years and strictly speaking creates a 2D “texture” or pattern. If I were to wrap that imagery around a 3D CAD model and print it on, say, a PolyJet multi-color 3D printer, I’d get a 3D part with a flat or perhaps curved surface decorated with a multi-color “picture” such as a map or a photo of leather. It could conform, but it’s still basically a decal.

A 3D texture instead is more properly referred to as Bump Mapping (not to be confused with …..too late….bit mapping). Bump mapping interprets the color/contrast information of a 2D image such that it renders light and shadow to give the illusion of a 3D part, while remaining in 2D. Taking this concept one step further, 3D CAD software such as SolidWorks can apply rules that convert white, black and grey shades into physical displacements, producing a kind of tessellated topology mapping. This new information can be saved as an STL file and generate a 3D printed part that has physical, tactile variations in material height across its surface. (For a detailed explanation and examples of texture versus bump-mapping, see the GrabCAD Tutorial “Adding Texture to 3D Models.”)

For FDM parts, you’ll get physical changes on the outer surface of the part that appear as your choice of say, a checkerboard, an arrangement of stars, a pebbly look or a series of waves. In the CAD software, you have a number of options for editing that bump map to produce bigger or smaller, higher or lower, finer or coarser variations of the original pattern, prior to saving the model file as an STL file.

Stepping through SolidWorks 3D Texturing

The key to making this option work in SolidWorks 3D CAD software (I’m using SolidWorks 2020), is in the Appearances tab. Here are the steps I’ve taken, highlighting the variety of choices you can make. My example is the Post-It Note holder I described in my PADT blog post about advanced infill options in GrabCAD Print.

  1. Open Post-It note CAD file, select Solid Bodies (left menu) and select Appearances (in the right toolbar).
A screenshot of a video game

Description automatically generated
  1. Expand Appearances and go all the way down to Miscellaneous, then click to open the 3D Textures folder.
A screenshot of a cell phone

Description automatically generated
  1. Scroll down to choose one of the more than 50 (currently) available patterns. Here, I’ve chosen a 5-pointed star pattern.
A screenshot of a computer

Description automatically generated
  1. I dragged and dropped that pattern onto the part body. A window opens up with several choices: the default is to apply the pattern to all faces:
A screenshot of a computer

Description automatically generated

However, you can mouse over within that pop-window to select only a single face, like this:

A screenshot of a computer

Description automatically generated
  1. When you’ve applied the pattern to either all faces or just one or two, you’ll see a new entry in the left window, Appearances, with the subheading: 5-pointed Star. Right-click on those words, and choose Edit Appearance:
A screenshot of a computer

Description automatically generated

Then the Appearances window expands as follows, opening by default to the Color/Image tab:

A screenshot of a computer

Description automatically generated

In this pane, if desired, you could even Browse to switch to a different pattern you have imported in a separate file.

  1. Click on Mapping, and you’ll see a number of “thumb wheel” sliders for resizing the pattern either via the wheel, clicking the up/down arrows, or just entering a value.

Mapping: this moves the pattern – you can see it march left or right, up or down. I used it to center the stars so there aren’t any half-stars cut off at the edge.

A screenshot of a computer

Description automatically generated

Size/Orientation: You can also try “Fit width to selection” or “Fit height to selection,” or experiment with height and width yourself, and even tilt the pattern at an angle. (If you don’t like the results, click on Reset Scale.) Here, I’ve worked with it to have two rows of five stars.

  1. Remember I said that you can also make the pattern higher or lower, like a change in elevation, so that it stands out a little or a lot. To make those choices, go to the Solid Bodies line in the Feature Manager tree, expand it, and click on the part name (mine is Champfer2).

In the fly-out window that appears, click on the third icon in the top row, “3D Texture.” This opens up an expanded window where you can refine the number of triangular facets that make up the shape of the selected texture pattern. In case you are working with more than one face and/or different patterns on each face, you would check the box under Texture Settings for each face when you want to edit it.

A screenshot of a computer

Description automatically generated

Here is where you can flip the pattern to extend outwards, or be recessed inwards, or, if you brought in a black/white 2D pattern in the first place, you can use this to convert it to a true 3D texture.

I’ll show you some variations of offset distance, refinement and element size, with exaggerated results, so you can see some of the possible effects:

A screenshot of a social media post

Description automatically generated

In this first example, the only change I made from the default was to increase the Texture Offset Distance from 0.010 to 0.200. The stars are extending out quite visibly.

Next, I changed Texture Refinement from 0% to 66.7%, and now you can see the stars more distinctly, with better defined edges:

A screenshot of a computer

Description automatically generated

Finally, I am going to change the Element size from 0.128 to 0.180in. It made the star edges only slightly sharper, though at the expense of increasing the number of facets from about 24,000 to 26,000; for large parts and highly detailed texturing, the increased file size could slow down slicing time.

  1. To make sure these textured areas print, you have to do one more special step: Convert to Mesh Body. Do this in the Feature Manager by right-clicking on the body, and selecting the second icon in the top row, “Convert to Mesh Body.” You can adjust some of these parameters, too, but I accepted the defaults.
A screenshot of a computer

Description automatically generated
  1. Lastly, Save the file in STL format, as usual.

At my company, PADT, my favorite FDM printer is our F370, so I’m going to set this up in GrabCAD Print software, to print there in ABS, at 0.005in layers:

A screenshot of a computer

Description automatically generated

You can definitely see the stars popping out on the front face; too bad you can also see two weird spikes part-way up, that are small bits of a partial row of stars. That means I should have split the face before I applied the texture, so that the upper portion was left plain. Well, next time.

Here’s the finished part, with its little spikes:

A picture containing table, sitting

Description automatically generated

And here’s another example I did when I was first trying out a checkerboard pattern; I applied the texture to all faces, so it came out a bit interesting with the checkerboard on the top and bottom, too. Again, next time, I would be more selective to split up the model.

A picture containing table, sitting, wooden, luggage

Description automatically generated

NOTE: It’s clear that texturing works much better on vertical faces than horizontal, due to the nature of the FDM layering process – just be sure to orient your parts to allow for this.

For More Information on Texturing

SolidWorks offers a number of tutorials on the texturing set-up process, such as http://help.solidworks.com/2019/english/solidworks/sldworks/c_3d_textures.htm, and Shuvom Ghose at GrabCAD gives even more details about what to expect with this process in his post https://grabcad.com/tutorials/how-to-3d-texture-your-parts-for-fdm-printing-using-solidworks-2019

There will also be a general Stratasys webinar on The Benefits of 3D Printing Physical Textures on July 29 at 9am PT.

Commercial aircraft companies are already adding a pebble texture to flight-approved cosmetic FDM parts, such as covers for brackets and switches that keep them from being bumped. If you try this out, let us know what texture you chose and send us a photo of your part.

PADT Inc. is a globally recognized provider of Numerical Simulation, Product Development and 3D Printing products and services, and is an authorized reseller of Stratasys products. For more information on Stratasys printers and materials, contact us at info@padtinc.com.