Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An example for this type of data file can be found [here](https://github.com/Ope
![Example of an OpenDIS file imported into OVITO Pro](examples/OpenDISFileReader.png)

## Description
This file reader imports the "nodes" in the OpenDIS file as particles and the "dislocation segments" or "arms" as [lines](https://docs.ovito.org/reference/pipelines/data_objects/lines.html) into OVITO.
This file reader imports the "nodes" in the OpenDIS file as particles and the "dislocation segments" as [lines](https://docs.ovito.org/reference/pipelines/data_objects/lines.html) into OVITO.

For more information and an example see this [discussion](https://github.com/OpenDiS/OpenDiS/issues/3).

Expand All @@ -25,7 +25,7 @@ For more information and an example see this [discussion](https://github.com/Ope
```

## Technical information / dependencies
- Tested on OVITO version 3.10.6
- Tested on OVITO version 3.16.0

## Contact
For questions or support regarding this file reader, please contact:
Expand Down
Binary file modified examples/ReaderExample_01.ovito
Binary file not shown.
63 changes: 21 additions & 42 deletions examples/ReaderExample_02.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Boilerplate code generated by OVITO Pro 3.11.0
# Boilerplate code generated by OVITO Pro 3.16.0
from ovito.io import *
from ovito.modifiers import *
from ovito.data import *
Expand All @@ -10,63 +10,42 @@
# ==== Set up pipeline ==== #

# Data import:
pipeline = import_file(
"https://raw.githubusercontent.com/OpenDiS/OpenDiS/refs/heads/main/examples/10_strain_hardening/180chains_16.10e.data"
)

pipeline = import_file('https://raw.githubusercontent.com/OpenDiS/OpenDiS/refs/heads/main/examples/10_strain_hardening/180chains_16.10e.data')

# Manual modifications of the imported data objects:
def modify_pipeline_input(frame: int, data: DataCollection):
data.particles_.particle_types_.type_by_id_(1).color = [
1.0,
0.6549019607843137,
0.10196078431372549,
]
data.particles_.particle_types_.type_by_id_(1).radius = 254.715391761


data.particles_.particle_types_.type_by_id_(1).radius = 50.9430783522
pipeline.modifiers.append(modify_pipeline_input)

# Color coding:
pipeline.modifiers.append(
ColorCodingModifier(
property="Normal vector.3",
start_value=-0.57735026919,
end_value=1.0,
gradient=ColorCodingModifier.Viridis(),
operate_on="lines:Arms",
)
)
pipeline.modifiers.append(ColorCodingModifier(
property = 'Normal vector.Z',
start_value = -1.0,
end_value = 1.0,
gradient = ColorCodingModifier.Viridis(),
operate_on = 'lines:Dislocations'))

# ======= Set up visual elements ======= #

# Configure visual elements for pipeline
pipeline.compute().cell.vis.line_width = 200.0
# Configure visual elements for pipeline
pipeline.compute().particles.vis.enabled = False
pipeline.compute().lines["Arms"].vis.width = 509.430783522
pipeline.compute().lines["Arms"].vis.color = [
1.0,
0.6549019607843137,
0.10196078431372549,
]
pipeline.compute().lines["Arms"].vis.shading = LinesVis.Shading.Normal
pipeline.compute().lines["Arms"].vis.wrapped_lines = True
pipeline.compute().lines['Dislocations'].vis.width = 101.886156704
pipeline.compute().lines['Dislocations'].vis.color = [0.78, 0.5, 0.2]
pipeline.compute().lines['Dislocations'].vis.flat_shading = False
pipeline.compute().lines['Dislocations'].vis.wrapped_lines = True

# Add pipelines to scene
# Add pipelines to visualization scene
pipeline.add_to_scene()

# ========== Set up rendering ========== #

# Viewport setup:
vp = Viewport(
type=Viewport.Type.Perspective,
fov=0.610865238198,
camera_dir=[0.5898716859872614, -0.6814919253105434, -0.43315141672061325],
camera_pos=[-96967.7306464858, 113863.44552512806, 67393.4705559644],
)

# Renderer setup:
renderer = AnariRenderer()
type = Viewport.Type.Perspective,
fov = 0.610865238198,
camera_dir = [-0.3148341696294794, 0.8948955463196848, -0.31629322915754804],
camera_pos = [51017.98315701337, -145015.19897572053, 51256.63233278926],
camera_up = [-0.12814427648248453, 0.29011228171908426, 0.9483743503493373])

# Rendering:
vp.render_image(filename="image.png", size=(1000, 1000), renderer=renderer)
vp.render_image(filename='image.png', size=(600, 600))
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ name = "OpenDiSFileReader"
version = "2026.4"
description = "File reader for the OpenDiS data format"
keywords = ["ovito", "ovito-extension"]
authors = [{name = "Daniel Utt", email = "utt@ovito.org"}, {name = "Alexander Stukowski", email = "stukowski@ovito.org"}]
authors = [
{name = "Daniel Utt", email = "utt@ovito.org"},
{name = "Alexander Stukowski", email = "stukowski@ovito.org"},
{name = "Nicolas Bertin", email = "bertin1@llnl.gov"}
]
maintainers = [{name = "Daniel Utt", email = "utt@ovito.org"}]
license = {text = "MIT"}
readme = "README.md"
Expand Down
Loading