Version: 6.3.1

Stream Lines

Create Stream Lines presentation on a field of the imported MED file:

import os

import salome

import VISU
import visu_gui

# The directory containing MED files
datadir = os.getenv("DATA_DIR")

# Get VISU engine
myVisu = visu_gui.myVisu

# Import a MED file
medFile = os.path.join(datadir,"MedFiles","fra.med")
myResult = myVisu.ImportFile(medFile)

# Create stream lines for the first timestamp of 'VITESSE' field
meshName = 'LE VOLUME'
fieldEntity = VISU.NODE
fieldName = 'VITESSE'
myStreamLines = myVisu.StreamLinesOnField(myResult, meshName, fieldEntity, fieldName, 1)

# Set stream lines parameters
integrationStep = 0.003
propagationTime = 1.5
stepLength = 0.015
# Mesh on nodes
prs3D = myVisu.MeshOnEntity(myResult, meshName, VISU.NODE) 
pointsPercents = 0.05
direction = VISU.StreamLines.FORWARD

myStreamLines.SetParams(integrationStep, propagationTime, stepLength, prs3D, pointsPercents, direction)

# Set magnitude coloring
myStreamLines.ShowColored(True)

# Update the object browser
salome.sg.updateObjBrowser(1)

# Display the newly created stream lines
myViewManager = myVisu.GetViewManager()
myView = myViewManager.Create3DView()

myView.DisplayOnly(myStreamLines)
myView.FitAll()


Please, see StreamLines interface reference documentation for more details.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS