scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.actor.property.opacity = 0.2
scp.module_manager.scalar_lut_manager.data_range = [0, 1]

### cutplane #4, normal to Ox, representation = contour
scp = ScalarCutPlane()
script.add_module(scp)
scp.implicit_plane.normal = (1, 0, 0)
scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.enable_contours = True
scp.contour.number_of_contours = 10
scp.contour.minimum_contour, scp.contour.maximum_contour = [0, 1]
scp.module_manager.scalar_lut_manager.data_range = [0, 1]

### cutplane #5, normal to Oy, representation = contour
scp = ScalarCutPlane()
script.add_module(scp)
scp.implicit_plane.normal = (0, 1, 0)
scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.enable_contours = True
scp.contour.number_of_contours = 10
scp.contour.minimum_contour, scp.contour.maximum_contour = [0, 1]
surface.contour.auto_contours = False
surface.contour.contours = [1.0]
surface.actor.property.opacity = 0.3

axes =mlab.axes(xlabel='x', ylabel='y', zlabel='z')
axes.axes.use_ranges = True
axes.axes.ranges = np.array([-1., -1.,  0.,  1.,  1.,  1.])

engine = mlab.get_engine()
module_manager = engine.scenes[0].children[0].children[0]

cut_plane = ScalarCutPlane()
engine.add_filter(cut_plane, module_manager)

cut_plane.warp_scalar.filter.normal = np.array([ 1.,  0.,  0.])
cut_plane.enable_contours = True
cut_plane.contour.auto_contours = True
cut_plane.contour.maximum_contour = 1.0
cut_plane.contour.number_of_contours = 3
cut_plane.contour.filled_contours = True
cut_plane.implicit_plane.widget.origin = np.array([ 15,10,5])
cut_plane.implicit_plane.widget.enabled = False

circle = ScalarCutPlane()
engine.add_filter(circle, module_manager)

circle.enable_contours = True
circle.contour.auto_contours = False
circle.contour.contours[0:1] = [1.0]
circle.implicit_plane.widget.origin = np.array([ 15,10,1.1])
circle.implicit_plane.widget.normal = np.array([ 0.,  0.,  1.])
示例#3
0
surface.contour.auto_contours = False
surface.contour.contours = [1.0]
surface.actor.property.opacity = 0.3

axes = mlab.axes(xlabel='x', ylabel='y', zlabel='z')
axes.axes.use_ranges = True
axes.axes.ranges = np.array([-1., -1., 0., 1., 1., 1.])

engine = mlab.get_engine()
module_manager = engine.scenes[0].children[0].children[0]

cut_plane = ScalarCutPlane()
engine.add_filter(cut_plane, module_manager)

cut_plane.warp_scalar.filter.normal = np.array([1., 0., 0.])
cut_plane.enable_contours = True
cut_plane.contour.auto_contours = True
cut_plane.contour.maximum_contour = 1.0
cut_plane.contour.number_of_contours = 3
cut_plane.contour.filled_contours = True
cut_plane.implicit_plane.widget.origin = np.array([15, 10, 5])
cut_plane.implicit_plane.widget.enabled = False

circle = ScalarCutPlane()
engine.add_filter(circle, module_manager)

circle.enable_contours = True
circle.contour.auto_contours = False
circle.contour.contours[0:1] = [1.0]
circle.implicit_plane.widget.origin = np.array([15, 10, 1.1])
circle.implicit_plane.widget.normal = np.array([0., 0., 1.])
scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.actor.property.opacity = 0.2
scp.module_manager.scalar_lut_manager.data_range = [0, 1]

### cutplane #4, normal to Ox, representation = contour
scp = ScalarCutPlane()
script.add_module(scp)
scp.implicit_plane.normal = (1, 0, 0)
scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.enable_contours = True
scp.contour.number_of_contours = 10
scp.contour.minimum_contour, scp.contour.maximum_contour = [0, 1]
scp.module_manager.scalar_lut_manager.data_range = [0, 1]

### cutplane #5, normal to Oy, representation = contour
scp = ScalarCutPlane()
script.add_module(scp)
scp.implicit_plane.normal = (0, 1, 0)
scp.implicit_plane.origin = (25, 25, 25)
scp.implicit_plane.widget.enabled = False
scp.actor.property.diffuse = 0.0
scp.actor.property.ambient = 1.0
scp.enable_contours = True
scp.contour.number_of_contours = 10
scp.contour.minimum_contour, scp.contour.maximum_contour = [0, 1]