def plane( origin, normal, options={} )
opacity = false
axes = false
options.each{ |key, val|
case key
when 'opacity'
opacity = val
when 'axes'
axes = val
else
raise "option (#{key}) is invalid"
end
}
plane = Vtk::Plane.new
plane.SetOrigin( origin )
plane.SetNormal( normal )
cutter = Vtk::Cutter.new
cutter.SetInput( @grid )
cutter.SetCutFunction( plane )
mapper = Vtk::PolyDataMapper.new
mapper.SetInput( cutter.GetOutput )
if @lookupTable
mapper.SetLookupTable( @lookupTable )
else
@lookupTable = mapper.GetLookupTable
end
actor = Vtk::Actor.new
actor.SetMapper( mapper )
actor.GetProperty.SetOpacity( options['opacity'] ) if opacity
@ren.AddActor( actor )
draw_axes( cutter, axes ) if axes
return nil
end