Example #1
0
    ## Create graphics interface.
    graphics = Graphics()

    ## Read in the model.
    mesh = Mesh(params)
    mesh.graphics = graphics
    mesh.read_mesh()

    ## Show faces with the number of cells.
    if params.filter_faces:
        mesh.filter_faces(params.filter_faces)
        show_wire = True
    else:
        show_wire = False

    if params.show_edges:
        mesh.show_edges()

    graphics.mesh = mesh

    if params.show_faces:
        mesh.show_faces()
    else:
        #graphics.add_graphics_geometry(mesh.surface, [0.8, 0.8, 0.8], wire=show_wire)
        graphics.add_graphics_geometry(mesh.surface, [0.8, 0.8, 0.8],
                                       edges=True)

    graphics.mesh = mesh
    graphics.show()
Example #2
0
            return None

    params.angle = kwargs.get(Args.ANGLE)
    params.use_feature_angle = kwargs.get(Args.USE_FEATURE_ANGLE)

    return params


if __name__ == '__main__':
    init_logging()
    args, print_help = parse_args()
    params = set_parameters(**vars(args))
    if not params:
        logger.error("Error in parameters.")
        sys.exit(1)

    ## Create graphics interface.
    graphics = Graphics()

    ## Read in the surface mesh.
    mesh = Mesh(params)
    mesh.graphics = graphics
    mesh.read_mesh()
    graphics.mesh = mesh
    graphics.add_graphics_geometry(mesh.surface, [0.8, 0.8, 0.8])
    graphics.add_graphics_face_components(mesh.boundary_edge_components,
                                          [1.0, 0.0, 0.0])

    graphics.mesh = mesh
    #graphics.show()
Example #3
0
      '''
      mapper = vtk.vtkPolyDataMapper()
      mapper.SetInputData(mesh.surface)
      mapper.SetScalarVisibility(True)
      mapper.SetScalarModeToUseCellFieldData()
      mapper.SetScalarRange(mesh.scalar_range)
      mapper.SetScalarModeToUseCellData()
      mapper.SetLookupTable(mesh.hue_lut)

      actor = vtk.vtkActor()
      actor.SetMapper(mapper)
      actor.GetProperty().EdgeVisibilityOn();
      graphics.renderer.AddActor(actor)
      '''
      #graphics.add_graphics_geometry(mesh.surface, [0.8, 0.8, 0.8], wire=True)
      graphics.add_graphics_geometry(mesh.surface, [0.8, 0.8, 0.8], wire=False, edges=True)
      graphics.add_graphics_geometry(mesh.area_surface, [1.0, 0.0, 0.0])

      color = [1.0, 0.0, 0.0]
      radius = 1.0
      size = 10
      for pt in mesh.failed_area_check_list:
        #graphics.add_sphere(pt, color, radius)
        graphics.add_markers([pt], color, size)

    ## Show faces with the number of cells.
    '''
    if params.filter_faces:
        mesh.filter_faces(params.filter_faces)
        show_wire = True
    else: