Remove Defect Mesh after performing DXA

Hello,

I am looking to render some animations of my simulation using the Python implementation of Ovito. In my simulation I have two fixed surfaces on the top and the bottom (as shown in the attached image). DXA picks these up as defects and therefore shows a defect mesh over the top. and bottom of the box, obstructing my view of my system. I am wondering how I might remove the defect mesh when I go to render my simulation results.

I am aware that this was asked previously in this thread, however I believe the solution in that case is to the change the settings of the DXA modifier. My question is can I remove the defect mesh after I have computed the pipeline? Can I remove visual elements from my pipeline after it has been computed? Please see my code for an example of what I’m currently trying to do.

from ovito.io import import_file
from ovito.vis import Viewport

# Import the precipitate IDs
prec_pipeline = import_file('000_data/03_pin_dislo/output/precipitate_ID.txt')

# Import the DXA results (Out of a CA file)
dxa_pipeline = import_file('000_data/03_pin_dislo/dxa/dxa_*')

# Load the pipelines to a scene
prec_pipeline.add_to_scene()
dxa_pipeline.add_to_scene()

# Create viewport settings
vp = Viewport()
vp.type = Viewport.Type.Perspective
vp.camera_dir = (0, 0, 0)
vp.zoom_all()

vp.render_image(size=(800,600), filename="figure.png", background=(1,1,1), frame=1000)

The reason why I ask this is because I perform DXA on my dump files on HPC system. I then download the processed DXA files (in CA format) for visualisation and subsequent data analysis.

Any help would be much appreciated!

Thanks,

E

You can view the visual elements currently in the pipeline using: pipeline.vis_elements. You can subsequently disable SurfaceMeshVis elements using this code:

from ovito.vis import SurfaceMeshVis

pipeline = import_file('test.ca')

for vis_element in pipeline.vis_elements:
    if isinstance(vis_element, SurfaceMeshVis):
        vis_element.enabled = False

Just for your information, even if it doesn’t directly answer your question about hiding the defect mesh later on: There is an undocumented option export_mesh=False, which allows you to export the DXA results to CA files so that only the dislocation lines are saved but not the defect mesh:

export_file(pipeline, "dislocs.*.ca", "ca", 
    multiple_frames=True, 
    export_mesh=False)

This can be useful if you know in advance that the defect mesh is irrelevant and you want to keep the CA files as compact as possible.

Hi both,

Thank you so much. This is very useful information.