引用本文: 张航城, 刘懿, 代凯, 宋天琦, 王乐, 曾薇, 杨义军. 一种基于局部坐标系的平面线段距离求解方法[J]. 计算机辅助设计与图形学学报. HangCheng ZHANG, Yi LIU, Kai DAI, TianQi SONG, Le WANG, Wei ZENG, YiJun YANG. An Algorithm to Compute the Distance of 2D Line Segments based on Local Coordinate System[J]. Journal of Computer-Aided Design & Computer Graphics.
 Citation: HangCheng ZHANG, Yi LIU, Kai DAI, TianQi SONG, Le WANG, Wei ZENG, YiJun YANG. An Algorithm to Compute the Distance of 2D Line Segments based on Local Coordinate System[J]. Journal of Computer-Aided Design & Computer Graphics. ## An Algorithm to Compute the Distance of 2D Line Segments based on Local Coordinate System

Abstract: The calculation of distances between basic geometric elements is a key algorithm in CAD geometry engines, which are widely applied in CAD software, including ship design and VLSI design. As the underlying high-frequency algorithm, the speed of distance calculation significantly affects the efficiency of the upper CAD software. In particular, distance calculation of planar line segments plays a very important role in VLSI design, Boolean operation and sketch design. In this paper, we propose a method for calculating the distance between two line segments based on the local coordinate system, and classify the distance calculation into 12 cases based on the end position of the two line segments. By calculating the position of the nearest point of two line segments, the distance calculation between two planar line segments is converted into the distance calculation between two nearest points. At the end of the paper, the efficiency of this algorithm is compared with the existing algorithms, and the efficiency of distance calculation between two line segments is improved by 23%-35% compared with the most efficient existing algorithm. / 下载:  全尺寸图片 幻灯片
• 分享
• 用微信扫码二维码

分享至好友和朋友圈