OCC.Display.OCCViewer module

class Viewer3d(window_handle)

Bases: OCC.Visualization.Display3d

Create(create_default_lights=True, draw_face_boundaries=True, phong_shading=True)
DisableAntiAliasing()
DisplayColoredShape(shapes, color='YELLOW', update=False)
DisplayMessage(point, text_to_write, height=None, message_color=None, update=False)
Point:a gp_Pnt or gp_Pnt2d instance
Text_to_write:a string
Message_color:triple with the range 0-1
DisplayShape(shapes, material=None, texture=None, color=None, transparency=None, update=False)
DisplayVector(vec, pnt, update=False)
DynamicZoom(X1, Y1, X2, Y2)
EnableAntiAliasing()
EraseAll()
ExportToImage(image_filename)
FitAll()
GetSelectedShape()

Returns the current selected shape

GetSelectedShapes()
MoveTo(X, Y)
OnResize()
Pan(dx, dy)
Repaint()
ResetView()
Rotation(X, Y)
Select(X, Y)
SelectArea(Xmin, Ymin, Xmax, Ymax)
SetBackgroundImage(image_filename, stretch=True)
SetDoubleBuffer(on_or_off)

enables double buffering when shapes are moved in the viewer a very shaky picture is drawn, since double buffering is disabled by default. fixed here...

SetModeHLR()
SetModeShaded()
SetModeWireFrame()
SetOrthographic(_bool)

sets whether this view is a orthographic or perspective view @param _bool:

SetSelectionMode(mode=None)
SetSelectionModeEdge()
SetSelectionModeFace()
SetSelectionModeNeutral()
SetSelectionModeShape()
SetSelectionModeVertex()
ShiftSelect(X, Y)
StartRotation(X, Y)
Tumble(num_images, animation=True)
View_Bottom()
View_Front()
View_Iso()
View_Left()
View_Rear()
View_Right()
View_Top()
Zoom(X, Y)
ZoomArea(X1, Y1, X2, Y2)
ZoomFactor(zoom_factor)
display_graduated_trihedron()
display_trihedron()

Show a black trihedron in lower right corner

register_select_callback(callback)

Adds a callback that will be called each time a shape s selected

set_bg_gradient_color(R1, G1, B1, R2, G2, B2)

set a bg vertical gradient color. R, G and B are floats.

set_raytracing_mode(shadows=True, reflections=True, antialiasing=True)
unregister_callback(callback)

Remove a callback from the callback list

get_color_from_name(color_name)

from the string ‘WHITE’, returns Quantity_Color WHITE. color_name is the color name, case insensitive.

rgb_color(r, g, b)
to_string(_string)