当前位置: 首页 > news >正文

万户网络网站管理系统织梦分类信息做的网站

万户网络网站管理系统,织梦分类信息做的网站,wordpress导航主题haow,有做美食的网站有哪些文章目录 基本控件创建创建文本框创建button创建布局 绘制形状绘制线段绘制点云 设置属性设置线宽设置点大小 可用Shader汇总GUI框架 基本控件创建 创建文本框 push_edit gui.TextEdit()创建button push_button gui.Button(...) push_button.horizontal_padding_em 0.5 p…

文章目录

  • 基本控件创建
    • 创建文本框
    • 创建button
    • 创建布局
  • 绘制形状
    • 绘制线段
    • 绘制点云
  • 设置属性
    • 设置线宽
    • 设置点大小
  • 可用Shader汇总
  • GUI框架

基本控件创建

创建文本框

push_edit = gui.TextEdit()

创建button

push_button = gui.Button('...')
push_button.horizontal_padding_em = 0.5
push_button.vertical_padding_em = 0
push_button.set_on_clicked(self._on_push_button) # 设置回调函数

创建布局

# 文本框和按钮水平布局
push_button_layout = gui.Horiz()
push_button_layout.add_child(gui.Label('Push Button'))
push_button_layout.add_child(self._push_edit)
push_button_layout.add_fixed(0.25*em)
push_button_layout.add_child(push_button)# 总体垂直布局
self.pannel = gui.Vert()
self.pannel.add_fixed(0.5*em)
self.pannel.add_child(push_button_layout)
self.window.add_child(self.pannel)

绘制形状

绘制线段

import open3d.visualization.gui as gui
points = [[0,0,0],[1,0,0],[0,1,0],[1,1,0],[0,0,1],[1,0,1],[0,1,1],[1,1,1]]
lines = [[0,1],[0,2],[1,3],[2,3],[4,5],[4,6],[5,7],[6,7],[0,4],[1,5],[2,6],[3,7]]
object_lines = o3d.geometry.LineSet(points=o3d.utility.Vector3dVector(points),lines=o3d.utility.Vector2iVector(lines),
)
# define material
material = rendering.MaterialRecord()
material.shader = 'defaultLit'# insert into scene
my_scene = gui.SceneWidget()
my_scene.scene = rendering.Open3DScene(w.renderer)
my_scene.scene.add_geometry('lines',object_lines ,material)
bounds = object_lines.get_axis_aligned_bounding_box()
my_scene.setup_camera(60,bounds,bounds.get_center())
my_scene.force_redraw()

绘制点云

import numpy as np
import open3d as o3d
import open3d.visualization.rendering as renderingcloud=o3d.io.read_point_cloud("your_path_to_point_cloud")
cloud_xyz=np.asarray(cloud.points)# define material
material = rendering.MaterialRecord()
material.shader = 'defaultLit'# define colors
ctmp=np.zeros((len(cloud_xyz),3))
ctmp[:,0]=1# rendering
object_pts=o3d.geometry.PointCloud()
object_pts.points=o3d.utility.Vector3dVector(cloud_xyz)
object_pts.colors=o3d.utility.Vector3dVector(ctmp)

设置属性

设置线宽

material_default = rendering.MaterialRecord()
material_default.shader = 'unlitLine'
material_default.line_width = 3
self._scene.scene.add_geometry('lines', object_lines,  material_default)

设置点大小

material = o3d.visualization.rendering.Material()
material.shader = "defaultLit"
material.base_color = color
material.point_size = size
scene.add_geometry(name, cloud, material)

可用Shader汇总

参考网址

类型
适用shader
网格defaultLit/defaultLitTransparencynormals
点云defaultLit/defaultLitTransparencynormalsdefaultUnlit/defaultUnlitTransparency
线段最好unlitLine,只有这个可以控制线宽

GUI框架

main_window.py

import open3d.visualization.gui as guiclass App:count = 0def __init__(self):# 初始化gui.Application.instance.initialize()self.window = gui.Application.instance.create_window("Event and Widget", 300, 600)# 使用相对大小避免直接设置像素,因为不同显示器像素大小可能不同em = self.window.theme.font_size# 文本框和按钮self._push_edit = gui.TextEdit()push_button = gui.Button('...')push_button.horizontal_padding_em = 0.5push_button.vertical_padding_em = 0push_button.set_on_clicked(self._on_push_button)# 文本框和按钮水平布局push_button_layout = gui.Horiz()push_button_layout.add_child(gui.Label('Push Button'))push_button_layout.add_child(self._push_edit)push_button_layout.add_fixed(0.25*em)push_button_layout.add_child(push_button)# 总体垂直布局self.pannel = gui.Vert()self.pannel.add_fixed(0.5*em)self.pannel.add_child(push_button_layout)self.window.add_child(self.pannel)def _on_push_button(self):self.count += 1# 设置文本框文字self._push_edit.text_value = f'push count {self.count}'# 弹出消息框self.window.show_message_box('Push Info', 'Hello World!')def run(self):gui.Application.instance.run()if __name__ == "__main__":app = App()app.run()
http://www.yayakq.cn/news/826303/

相关文章:

  • 比较好的网站空间海南网站建设案例
  • 网站建设的上机报告成都网站建设与开发
  • 电子商务网站建设预算表wordpress 主题添加标签
  • 网站开发中网页之间的连接形式有网站空间租用多少钱
  • 阀门行业网站怎么做wordpress nginx 配置文件
  • 制作简易网站《学做网站论坛》视频下载
  • 自适应网站建设都找全网天下深圳aso优化
  • 企业网站维护存在问题腾讯云网站搭建流程
  • 网站怎么使用html 网站根目录
  • 丽水建设局门户网站什么网站可以接单做设计
  • 纪检监察机关网站建设方案微信wap网站
  • 网络优化首先要有网站现在的网站做多大尺寸的
  • 开通网站申请书电影购票网站开发背景
  • 邢台市住房和城乡建设局网站南京中企动力有限公司
  • 企业管理咨询网站模板uniapp开发者中心
  • 外贸网站产品关键词深圳网站设计合理刻
  • 网站开发设计工程师博客网站seo
  • 网站作弊温州网牌电线
  • 自网站EXCel数据导入怎么做脑叶公司
  • 高效网站推广费用门户设计方案
  • 网站如何做微信推广方案设计进入秦皇岛最新规定
  • 东莞怎么建设网站公司有什么做任务的网站吗
  • 网站建设信息在哪儿发布广东省自然资源厅招聘
  • 北京建网站开发网络营销是什么工作内容
  • 磁县网站设计公司屏蔽wordpress google
  • 网站推广引流最快方法swiper wordpress主题
  • 做网站推广维护需要学些什么网站 别名
  • 郑州制作网站个人网站可以不备案吗
  • 有没有可以做游戏的网站吗山东省建设工程注册中心网站
  • 网站怎么挣钱wordpress防站