示例#1
0
    # lwr.SetFileName("tux1.png")

    scale = 1
    myscreen.render()
    random.seed(42)
    far = 1
    camPos = far
    zmult = 3
    # camPos/float(1000)
    myscreen.camera.SetPosition(0, -camPos / float(1000), zmult * camPos)
    myscreen.camera.SetClippingRange(-(zmult + 1) * camPos,
                                     (zmult + 1) * camPos)
    myscreen.camera.SetFocalPoint(0.0, 0, 0)

    vd = ovd.VoronoiDiagram(far, 120)
    print(ovd.version()), " ", ovd.build_type()

    # for vtk visualization
    vod = ovdvtk.VD(myscreen,
                    vd,
                    float(scale),
                    textscale=0.01,
                    vertexradius=0.003)
    vod.drawFarCircle()
    vod.textScale = 0.002
    vod.vertexRadius = 0.00031
    vod.drawVertices = 0
    vod.drawVertexIndex = 0
    vod.drawGenerators = 0
    vod.offsetEdges = 1
    vd.setEdgeOffset(0.001)
    #       30   416
    #       20   627

    # wr.cubic_biarc_subdivision = 10 # no effect?
    # wr.cubic_line_subdivision = 10 # no effect?
    # wr.setFont(0)
    # wr.setFontbyPath("/usr/share/fonts/truetype/freefont/FreeSerif.ttf")
    s3 = ttt.ttt(text, wr)
    exts = wr.extents
    # print exts
    segs = wr.get_segments()
    return (segs, exts)


if __name__ == "__main__":
    print ovd.version() + " " + ovd.build_type()
    # w=2500
    # h=1500

    # w=1920
    # h=1080
    w = 1024
    h = 1024
    myscreen = ovdvtk.VTKScreen(width=w, height=h)
    ovdvtk.drawOCLtext(myscreen, rev_text=ovd.version())

    scale = 1

    far = 1
    camPos = far
    zmult = 3
示例#3
0
    # lwr.SetFileName("tux1.png")

    scale = 1
    myscreen.render()
    random.seed(42)
    far = 1
    camPos = far
    zmult = 3
    # camPos/float(1000)
    myscreen.camera.SetPosition(0, -camPos / float(1000), zmult * camPos)
    myscreen.camera.SetClippingRange(-(zmult + 1) * camPos,
                                     (zmult + 1) * camPos)
    myscreen.camera.SetFocalPoint(0.0, 0, 0)

    vd = ovd.VoronoiDiagram(far, 120)
    print ovd.version(), " ", ovd.build_type()

    # for vtk visualization
    vod = ovdvtk.VD(myscreen,
                    vd,
                    float(scale),
                    textscale=0.01,
                    vertexradius=0.003)
    vod.drawFarCircle()
    vod.textScale = 0.002
    vod.vertexRadius = 0.00031
    vod.drawVertices = 0
    vod.drawVertexIndex = 0
    vod.drawGenerators = 0
    vod.offsetEdges = 1
    vd.setEdgeOffset(0.001)
示例#4
0
    # w2if.Modified()
    # lwr.SetFileName("tux1.png")

    scale = 1
    myscreen.render()
    random.seed(42)
    far = 1
    camPos = far
    zmult = 3
    # camPos/float(1000)
    myscreen.camera.SetPosition(0, -camPos / float(1000), zmult * camPos)
    myscreen.camera.SetClippingRange(-(zmult + 1) * camPos, (zmult + 1) * camPos)
    myscreen.camera.SetFocalPoint(0.0, 0, 0)

    vd = ovd.VoronoiDiagram(far, 120)
    print ovd.version(), ovd.build_type()

    # for vtk visualization
    vod = ovdvtk.VD(myscreen, vd, float(scale), textscale=0.01, vertexradius=0.003)
    vod.drawFarCircle()

    vod.textScale = 0.02
    vod.vertexRadius = 0.0031
    vod.drawVertices = 0
    vod.drawVertexIndex = 1
    vod.drawGenerators = 0
    vod.offsetEdges = 1
    vd.setEdgeOffset(0.05)

    linesegs = 1  # switch to turn on/off line-segments
示例#5
0
    # w2if.Modified()
    # lwr.SetFileName("tux1.png")

    scale = 1
    myscreen.render()
    random.seed(42)
    far = 1
    camPos = far
    zmult = 3
    # camPos/float(1000)
    myscreen.camera.SetPosition(0, -camPos / float(1000), zmult * camPos)
    myscreen.camera.SetClippingRange(-(zmult + 1) * camPos, (zmult + 1) * camPos)
    myscreen.camera.SetFocalPoint(0.0, 0, 0)

    vd = ovd.VoronoiDiagram(far, 120)
    print((ovd.version(), ovd.build_type()))

    # for vtk visualization
    vod = ovdvtk.VD(myscreen, vd, float(scale), textscale=0.01, vertexradius=0.003)
    vod.drawFarCircle()

    vod.textScale = 0.02
    vod.vertexRadius = 0.0031
    vod.drawVertices = 0
    vod.drawVertexIndex = 1
    vod.drawGenerators = 0
    vod.offsetEdges = 1
    vd.setEdgeOffset(0.05)

    linesegs = 1  # switch to turn on/off line-segments
    #wr.conic = False
    #wr.cubic = False
    wr.scale = 1e-4 #float(1)/float(scale)
    # "L" has 36 points by default
    #wr.conic_biarc_subdivision = 10 # this has no effect?
    #wr.conic_line_subdivision = 50 # =10 increasesn nr of points to 366, = 5 gives 729 pts
    #wr.cubic_biarc_subdivision = 10 # no effect?
    #wr.cubic_line_subdivision = 10 # no effect?
    #wr.setFont(0)
    s3 = ttt.ttt(text,wr) 
    segs = wr.get_segments()
    return segs
    

if __name__ == "__main__":  
    print ovd.version() + " " + ovd.build_type()
    #w=2500
    #h=1500
    
    #w=1920
    #h=1080
    w=1024
    h=1024
    myscreen = ovdvtk.VTKScreen(width=w, height=h) 
    ovdvtk.drawOCLtext(myscreen, rev_text=ovd.version() )
    
    scale=1

    far = 1
    camPos = far
    zmult = 3
    #       30   416
    #       20   627

    # wr.cubic_biarc_subdivision = 10 # no effect?
    # wr.cubic_line_subdivision = 10 # no effect?
    # wr.set_font(0)
    # wr.set_font_by_path("/usr/share/fonts/truetype/freefont/FreeSerif.ttf")
    s3 = ttt.ttt(text, wr)
    exts = wr.extents
    # print exts
    segs = wr.get_segments()
    return (segs, exts)


if __name__ == "__main__":
    print("%s %s" % (ovd.version(), ovd.build_type()))
    # w=2500
    # h=1500

    # w=1920
    # h=1080
    w = 1024
    h = 1024
    myscreen = ovdvtk.VTKScreen(width=w, height=h)
    ovdvtk.drawOCLtext(myscreen, rev_text=ovd.version())

    scale = 1

    far = 1
    camPos = far
    zmult = 3