摘要
【目的】实现在基于万维引擎平台的虚拟设备拆解零部件运动控制及平铺。【方法】首先运动控制算法通过解析输入的参数,应用线性插值与坐标系转换实现给定时间内控制物体的移动与旋转;其次用平铺算法识别虚拟设备模型中的各零部件并进行排序,通过递归查找子对象,计算零部件尺寸,设置位置参数,并在三维空间中进行布局调整,最终实现零部件平铺;最后使用TypeScript语言将算法编译成代码,并打包封装成JavaScript文件,以供万维引擎平台使用。【结果】试验1表明零部件5 s内从(0,0,0)移动到(10,0,0)的过程中,实际运动时间有±0.02 s的误差,终点位置有0.001 mm的误差;试验2表明位置误差在0.005 mm之内,角度误差在0.12°之内,运动时间和实际终点误差小,运动控制精确;试验3表明平铺算法有效地提高了虚拟设备零部件在平面上的平铺空间利用率。【结论】基于WebGL技术的虚拟设备拆解零部件运动控制和平铺算法,不仅能够精确控制零部件在轨迹点之间的连贯移动和旋转,而且实现了复杂设备零部件在指定平面上的高效自动化布置。本研究结果可为虚拟现实环境或三维游戏中的对象控制运动轨迹和均匀排列场景提供参考。
[Objective]An endeavor was made to achieve motion control and tiling of virtual equipment components on the Web Engine platform.[Method]First,the motion control algorithm parsed input parameters,utilizing linear interpolation and coordinate system transformation to achieve controlled object movement and rotation within specified timeframes;then,the tiling algorithm identified and sorted components in the virtual equipment model,calculated component dimensions,set positional parameters,and adjusted spatial arrangements in the three-dimensional space through recursive sub-object search to ultimately achieve optimal component placement;finally,the algorithms were compiled into JavaScript code by using TypeScript and pack aged for platform compatibility.[Result]Test 1 demonstrates a±0.02-second time deviation and 0.001 mm position error when moving components from(0,0,0)to(10,0,0)within 5 seconds;test 2 shows position errors within 0.005 mm and angle deviations under 0.12°,with minimal time and endpoint errors,confirming precise motion control;test 3 verifies effectiveness of the tiling algorithm in improving tiling spatial utilization of virtual equipment components on planar surfaces.[Conclusion]The WebGL-based motion control and tiling algorithms for virtual equipment components not only ensures smooth trajectory transitions between component rotations but also enables efficient automated arrangement of complex equipment parts on designated planes.These findings can provide a valuable reference for object motion control trajectory and uniform arrangement scenarios in virtual reality environments or 3D gaming applications.
作者
徐爱群
刘正涛
XU Aiqun;LIU Zhengtao(School of Intelligent Manufacturing and Energy Engineering,Zhejiang University of Science and Technology,Hangzhou 310023,Zhejiang,China)
出处
《浙江科技大学学报》
2025年第6期559-570,共12页
Journal of Zhejiang University of Science and Technology
基金
浙江省“十四五”研究生教育改革项目(2023gerp293)。
关键词
WEB环境
虚拟拆装
运动控制
平铺
工业仿真
Web environment
virtual disassembly and assembly
motion control
tiling
industrial simulation