Version: 6.3.1

Cut Segment

Create Cut Segment 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 a cut segment for the first timestamp of 'VITESSE' field
meshName = 'LE VOLUME'
fieldEntity = VISU.NODE
fieldName = 'VITESSE'
myCutSegment = myVisu.CutSegmentOnField(myResult, meshName, fieldEntity, fieldName, 1)

# Set the first point of the segment
myCutSegment.SetPoint1(0, 0, 0)

# Set the second point of the segment
myCutSegment.SetPoint2(0.41, 0.0685, 1.082)

# Invert the resulting curve
myCutSegment.SetAllCurvesInverted(True)

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

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

myView.DisplayOnly(myCutSegment)
myView.FitAll()


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