Version: 6.3.1

Cut Planes

Create Cut Planes 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 cut planes for the first timestamp of 'VITESSE' field
meshName = 'LE VOLUME'
fieldEntity = VISU.NODE
fieldName = 'VITESSE'
myCutPlanes = myVisu.CutPlanesOnField(myResult, meshName, fieldEntity, fieldName, 1)

# Set the number of planes
myCutPlanes.SetNbPlanes(15)

# Set the planes orientation (parallel to XY), set rotation around Y to 0.5 radian
myCutPlanes.SetOrientation(VISU.CutPlanes.XY, 0, 0.5)

# Set the scale
myCutPlanes.UseDeformation(True)
myCutPlanes.SetVectorialField(fieldEntity, fieldName)
myCutPlanes.SetScale(0.05)

# Set the displacement
myCutPlanes.SetDisplacement(0.1)

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

# Display the newly created cut planes
myViewManager = myVisu.GetViewManager()
myView = myViewManager.Create3DView()

myView.DisplayOnly(myCutPlanes)
myView.FitAll()


Please, see CutPlanes 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