当前位置: 首页>>代码示例>>Python>>正文


Python pythreejs.LineBasicMaterial方法代码示例

本文整理汇总了Python中pythreejs.LineBasicMaterial方法的典型用法代码示例。如果您正苦于以下问题:Python pythreejs.LineBasicMaterial方法的具体用法?Python pythreejs.LineBasicMaterial怎么用?Python pythreejs.LineBasicMaterial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pythreejs的用法示例。


在下文中一共展示了pythreejs.LineBasicMaterial方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: joint_children

# 需要导入模块: import pythreejs [as 别名]
# 或者: from pythreejs import LineBasicMaterial [as 别名]
def joint_children(joints3D, color="blue", links=None):
    material = p3js.LineBasicMaterial(color=color, linewidth=4)

    scene_children = []
    # For each 24 joint
    if links is None:
        links = [
            (0, 1, 2, 3, 4),
            (0, 5, 6, 7, 8),
            (0, 9, 10, 11, 12),
            (0, 13, 14, 15, 16),
            (0, 17, 18, 19, 20),
        ]
    for link in links:
        for j1, j2 in zip(link[0:-1], link[1:]):
            geometry = p3js.Geometry(vertices=joints3D[(j1, j2), :].tolist())
            line = p3js.Line(geometry, material)
            scene_children.append(line)
    return scene_children 
开发者ID:hassony2,项目名称:obman_train,代码行数:21,代码来源:visualizemeshes.py

示例2: lines_children

# 需要导入模块: import pythreejs [as 别名]
# 或者: from pythreejs import LineBasicMaterial [as 别名]
def lines_children(origins, targets, color="blue"):
    material = p3js.LineBasicMaterial(color=color, linewidth=4)

    scene_children = []
    # For each 24 joint
    for origin, target in zip(origins, targets):
        geometry = p3js.Geometry(vertices=np.array([origin, target]).tolist())
        line = p3js.Line(geometry, material)
        scene_children.append(line)
    return scene_children 
开发者ID:hassony2,项目名称:obman_train,代码行数:12,代码来源:visualizemeshes.py

示例3: __add_line_geometry

# 需要导入模块: import pythreejs [as 别名]
# 或者: from pythreejs import LineBasicMaterial [as 别名]
def __add_line_geometry(self, lines, shading, obj=None):
        lines = lines.astype("float32", copy=False)
        mi = np.min(lines, axis=0)
        ma = np.max(lines, axis=0)
        geometry = p3s.BufferGeometry(attributes={'position': p3s.BufferAttribute(lines, normalized=False)})
        material = p3s.LineBasicMaterial(linewidth=shading["line_width"], color=shading["line_color"])
                    #, vertexColors='VertexColors'),
        lines = p3s.LineSegments(geometry=geometry, material=material) #type='LinePieces')
        line_obj = {"geometry": geometry, "mesh": lines, "material": material,
                    "max": ma, "min": mi, "type": "Lines", "wireframe": None}

        if obj:
            return self.__add_object(line_obj, obj), line_obj
        else:
            return self.__add_object(line_obj) 
开发者ID:skoch9,项目名称:meshplot,代码行数:17,代码来源:Viewer.py

示例4: get_polylines_pythreejs

# 需要导入模块: import pythreejs [as 别名]
# 或者: from pythreejs import LineBasicMaterial [as 别名]
def get_polylines_pythreejs(polylines):
    lines = []
    for x in polylines:
        line_geometry = pythreejs.Geometry(
            vertices=x["vertices"])
        linewidth = x.get("linewidth", 1.0)
        line = pythreejs.Line(
            geometry=line_geometry,
            material=pythreejs.LineBasicMaterial(color=x["color"], linewidth=linewidth),
            type='LinePieces')
        lines.append(line)

    return lines 
开发者ID:daavoo,项目名称:pyntcloud,代码行数:15,代码来源:pythreejs_backend.py

示例5: ray2mesh

# 需要导入模块: import pythreejs [as 别名]
# 或者: from pythreejs import LineBasicMaterial [as 别名]
def ray2mesh(ray):
    rays=py3js.Group()

    w = ray.wavelength
    rc, gc, bc = wavelength2RGB(w)
    rc=int(255*rc)
    gc=int(255*gc)
    bc=int(255*bc)
    material = py3js.LineBasicMaterial(color = "#{:02X}{:02X}{:02X}".format(rc,gc,bc))



    rl = ray2list(ray)

    for r in rl:
        geometry = py3js.Geometry()
        geometry.vertices =  r
        line = py3js.Line( geometry, material)
        rays.add(line)

    return rays


#def ray2mesh(ray):
#    rays=py3js.Group()

#    P1 = ray.pos
#    w = ray.wavelength
#    rc, gc, bc = wavelength2RGB(w)
#    rc=int(255*rc)
#    gc=int(255*gc)
#    bc=int(255*bc)
#    material = py3js.LineBasicMaterial(color = "#{:02X}{:02X}{:02X}".format(rc,gc,bc))

#    if len(ray.childs) > 0:
#        P2 = ray.childs[0].pos
#    else:
#        P2 = P1 + 10. * ray.dir
    
#    if ray.intensity != 0:
        
#        geometry = py3js.Geometry()
    
#        geometry.vertices =  [list(P1),list(P2)]
        
#        line = py3js.Line( geometry, material)
        
#        rays.add(line)
    
#    for i in ray.childs:
#        rays.add(ray2mesh(i))
#    return rays 
开发者ID:cihologramas,项目名称:pyoptools,代码行数:54,代码来源:ipywidgets.py


注:本文中的pythreejs.LineBasicMaterial方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。