本文整理汇总了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
示例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
示例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)
示例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
示例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