[go: up one dir, main page]

CN118427950A - Wall distance recognition method, device, storage medium and processor in CAD - Google Patents

Wall distance recognition method, device, storage medium and processor in CAD Download PDF

Info

Publication number
CN118427950A
CN118427950A CN202410883167.0A CN202410883167A CN118427950A CN 118427950 A CN118427950 A CN 118427950A CN 202410883167 A CN202410883167 A CN 202410883167A CN 118427950 A CN118427950 A CN 118427950A
Authority
CN
China
Prior art keywords
distance
wall
intersection
object set
straight line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410883167.0A
Other languages
Chinese (zh)
Other versions
CN118427950B (en
Inventor
邓智文
何鑫星
阳建逸
佘毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Surveying And Mapping Product Quality Supervision And Inspection Station Ministry Of Natural Resources (sichuan Surveying And Mapping Product Quality Supervision And Inspection Station)
Original Assignee
Sichuan Surveying And Mapping Product Quality Supervision And Inspection Station Ministry Of Natural Resources (sichuan Surveying And Mapping Product Quality Supervision And Inspection Station)
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Surveying And Mapping Product Quality Supervision And Inspection Station Ministry Of Natural Resources (sichuan Surveying And Mapping Product Quality Supervision And Inspection Station) filed Critical Sichuan Surveying And Mapping Product Quality Supervision And Inspection Station Ministry Of Natural Resources (sichuan Surveying And Mapping Product Quality Supervision And Inspection Station)
Priority to CN202410883167.0A priority Critical patent/CN118427950B/en
Publication of CN118427950A publication Critical patent/CN118427950A/en
Application granted granted Critical
Publication of CN118427950B publication Critical patent/CN118427950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/13Architectural design, e.g. computer-aided architectural design [CAAD] related to design of buildings, bridges, landscapes, production plants or roads
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Architecture (AREA)
  • Civil Engineering (AREA)
  • Structural Engineering (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了CAD中墙体距离识别方法、装置、存储介质及处理器,方法包括步骤:读取待识别CAD图纸的图层信息;分别拾取点1和点2,点1和点2间构成第一线段,第一线段与目标墙体相交;在图层信息中查询与第一线段相交的所有直线,提取所有交点并计算交点与点1的第一距离,构建第一交点对象集合;去除第一交点对象集合中第一距离相等的重复交点,获得第二交点对象集合;在第二交点对象集合中依次选择第一距离最小、最大、次小、次大的交点对象P1、P2、P3和P4,构建第三交点对象集合;若第三交点对象集合中仅包含P1和P2,则以P1为端点作与P2所在直线垂直的第一垂线,判断第一垂线的垂足是否在P2所在直线上,若是,则以第一垂线的长度为墙体距离。

The invention discloses a wall distance recognition method, device, storage medium and processor in CAD. The method comprises the following steps: reading layer information of a CAD drawing to be recognized; picking up point 1 and point 2 respectively, wherein a first line segment is formed between point 1 and point 2, and the first line segment intersects with a target wall; querying all straight lines intersecting with the first line segment in the layer information, extracting all intersections and calculating the first distance between the intersection and point 1, and constructing a first intersection object set; removing repeated intersections with equal first distances in the first intersection object set, and obtaining a second intersection object set; selecting intersection objects P1, P2, P3 and P4 with the smallest, largest, second smallest and second largest first distances in the second intersection object set in turn, and constructing a third intersection object set; if the third intersection object set only contains P1 and P2, drawing a first perpendicular line perpendicular to the straight line where P2 is located with P1 as the endpoint, judging whether the foot of the first perpendicular line is on the straight line where P2 is located, and if so, taking the length of the first perpendicular line as the wall distance.

Description

CAD中墙体距离识别方法、装置、存储介质及处理器Wall distance recognition method, device, storage medium and processor in CAD

技术领域Technical Field

本发明涉及CAD二次开发技术领域,尤其涉及CAD中墙体距离识别方法、装置、存储介质及处理器。The present invention relates to the technical field of CAD secondary development, and in particular to a wall distance recognition method, device, storage medium and processor in CAD.

背景技术Background technique

随着计算机辅助设计(CAD)技术的广泛应用,CAD图纸在建筑、工程和制造等领域得到了广泛的使用。建筑验收是指建筑工程在完成施工后,由相关部门、单位或个人按照国家和地方的相关法规、标准、规范,对建筑工程的质量、功能、安全性等方面进行全面检查和评估,并确定是否符合设计要求和使用功能的过程。建筑验收是确保建筑工程质量和安全的重要环节,是建筑工程进入使用阶段的前提条件。其中,建筑墙体距离的尺寸复核是验收流程中非常重要的一环,其验收步骤概括如下:With the widespread application of computer-aided design (CAD) technology, CAD drawings have been widely used in fields such as architecture, engineering, and manufacturing. Building acceptance refers to the process in which relevant departments, units, or individuals conduct a comprehensive inspection and evaluation of the quality, function, safety, etc. of a building project in accordance with relevant national and local laws, standards, and specifications after the completion of the construction project, and determine whether it meets the design requirements and usage functions. Building acceptance is an important link in ensuring the quality and safety of construction projects, and is a prerequisite for construction projects to enter the use stage. Among them, the dimensional review of the distance between building walls is a very important part of the acceptance process, and the acceptance steps are summarized as follows:

验收人员在现场使用计算机或其他设备打开相关的CAD图纸,通过CAD软件查看和识别设计图纸上各目标墙体间的距离,然后使用专业测量工具(如卷尺、激光测距仪、全站仪等)对建筑物墙体的实际距离尺寸进行测量,最后将现场测量得到的实际尺寸与CAD图纸上识别的设计尺寸进行逐一对比,记录尺寸偏差,分析偏差原因,判断是否在允许的误差范围内。The acceptance personnel use a computer or other equipment to open the relevant CAD drawings on site, view and identify the distances between the target walls on the design drawings through the CAD software, and then use professional measuring tools (such as tape measures, laser rangefinders, total stations, etc.) to measure the actual distance dimensions of the building walls. Finally, the actual dimensions measured on site are compared with the design dimensions identified on the CAD drawings one by one, the dimensional deviations are recorded, the causes of the deviations are analyzed, and it is determined whether they are within the allowable error range.

目前,验收人员大多携带平板电脑等便携式设备到现场以打开相关的CAD图纸,然后通过触摸屏进行滑动查看和距离标注。这种操作方式存在以下的不足之处:1、触摸偏差:手指触摸点与实际目标识别点之间可能存在较大的偏差,特别是在线条繁复的图纸上。这种情况下,手指触摸得到的识别点很难准确聚焦于目标识别点,导致验收人员需要进行多次调整和操作才能选中正确的点位。2、选择繁琐:目前主流的CAD软件在进行距离标注或测量时,识别点的选择较为繁琐。特别是在测量两平行墙体线条之间的距离时,CAD软件通常要求操作人员分别在两条墙体线条上选择互相垂直的两个点进行测量。这种操作需要较高的精确度和多次调整,增加了工作量和操作复杂度。3、不符合现场实际情况:当两平行墙体线条上没有互相垂直的点时,CAD软件自带的标注或测量工具会自动生成其中一条线条的延长线,并在延长线上寻找垂点进行测量。然而,这种做法并不符合现场的实际情况,因为实际的墙体显然是不可能被任意延长的。这样的测量结果往往不准确,无法真实反映现场的墙体距离,给验收工作带来误差和不便。At present, most acceptance personnel bring portable devices such as tablet computers to the site to open relevant CAD drawings, and then use the touch screen to slide and view and mark the distance. This operation method has the following shortcomings: 1. Touch deviation: There may be a large deviation between the finger touch point and the actual target recognition point, especially on drawings with complex lines. In this case, it is difficult for the recognition point obtained by finger touch to accurately focus on the target recognition point, resulting in the acceptance personnel needing to make multiple adjustments and operations to select the correct point. 2. Cumbersome selection: The current mainstream CAD software is cumbersome to select recognition points when marking or measuring distances. Especially when measuring the distance between two parallel wall lines, CAD software usually requires operators to select two points perpendicular to each other on the two wall lines for measurement. This operation requires high precision and multiple adjustments, which increases the workload and operation complexity. 3. It does not conform to the actual situation on site: When there are no points perpendicular to each other on two parallel wall lines, the marking or measuring tools provided by the CAD software will automatically generate an extension line of one of the lines and find a vertical point on the extension line for measurement. However, this approach does not conform to the actual situation on site, because the actual wall is obviously impossible to be extended arbitrarily. Such measurement results are often inaccurate and cannot truly reflect the wall distance on site, causing errors and inconvenience to the acceptance work.

发明内容Summary of the invention

为了解决上述现有技术中存在的不足之处,本发明提供了一种CAD中墙体距离识别方法、装置、存储介质及处理器,具体包括:In order to solve the deficiencies in the above-mentioned prior art, the present invention provides a wall distance recognition method, device, storage medium and processor in CAD, specifically including:

CAD中墙体距离识别方法,包括步骤:The wall distance recognition method in CAD includes the following steps:

读取待识别CAD图纸的图层信息;Read the layer information of the CAD drawing to be identified;

在所述待识别CAD图纸上分别拾取点1和点2,所述点1和所述点2间构成第一线段,所述第一线段与目标墙体相交;Picking up point 1 and point 2 on the CAD drawing to be identified respectively, wherein a first line segment is formed between point 1 and point 2, and the first line segment intersects with the target wall;

在所述图层信息中查询与所述第一线段相交的所有直线,提取所有交点并计算所述交点与所述点1的第一距离,构建第一交点对象集合;Searching the layer information for all straight lines intersecting the first line segment, extracting all intersection points, calculating a first distance between the intersection points and point 1, and constructing a first intersection point object set;

去除所述第一交点对象集合中所述第一距离相等的重复交点,获得第二交点对象集合;Removing duplicate intersections with the same first distance from the first intersection object set to obtain a second intersection object set;

在所述第二交点对象集合中依次选择所述第一距离最小、最大、次小、次大的交点对象P1、P2、P3和P4,构建第三交点对象集合;Select the intersection objects P1, P2, P3 and P4 with the smallest, largest, second smallest and second largest first distances in sequence from the second intersection object set to construct a third intersection object set;

若所述第三交点对象集合中仅包含P1和P2,则以P1为端点作与P2所在直线垂直的第一垂线,判断所述第一垂线的垂足是否在所述P2所在直线上,若是,则以所述第一垂线的长度为墙体距离,若否,则以P1与所述P2所在直线的端点的最小距离为墙体距离。If the third intersection object set only includes P1 and P2, then draw a first perpendicular line with P1 as the endpoint and perpendicular to the straight line where P2 is located, and determine whether the foot of the first perpendicular line is on the straight line where P2 is located. If so, the length of the first perpendicular line is used as the wall distance. If not, the minimum distance between P1 and the endpoints of the straight line where P2 is located is used as the wall distance.

在一些较优的实施例中,若所述第三交点对象集合中包含P1、P2、P3和P4,以P1为端点作与P4所在直线垂直的第二垂线,判断所述第二垂线的垂足是否在所述P4所在直线上,若是,则以所述第二垂线的长度为墙体距离为外侧墙体距离,若否,则以P1与所述P4所在直线的端点的最小距离为外侧墙体距离。In some preferred embodiments, if the third intersection object set includes P1, P2, P3 and P4, a second perpendicular line is drawn with P1 as the endpoint and perpendicular to the straight line where P4 is located, and it is determined whether the foot of the second perpendicular line is on the straight line where P4 is located. If so, the length of the second perpendicular line is taken as the wall distance and the outer wall distance. If not, the minimum distance between P1 and the endpoints of the straight line where P4 is located is taken as the outer wall distance.

优选的,若所述第三交点对象集合中包含P1、P2、P3和P4,以P1为端点作与P3所在直线垂直的第三垂线,判断所述第三垂线的垂足是否在所述P3所在直线上,若是,则以所述第三垂线的长度为墙体距离为外侧墙体至内侧墙体距离,若否,则以P1与所述P3所在直线的端点的最小距离为外侧墙体至内侧墙体距离。Preferably, if the third intersection object set includes P1, P2, P3 and P4, a third perpendicular line is drawn with P1 as the endpoint and perpendicular to the straight line where P3 is located, and it is determined whether the foot of the third perpendicular line is on the straight line where P3 is located. If so, the length of the third perpendicular line is used as the wall distance, which is the distance from the outer wall to the inner wall. If not, the minimum distance between P1 and the endpoints of the straight line where P3 is located is used as the distance from the outer wall to the inner wall.

优选的 ,若所述第三交点对象集合中包含P1、P2、P3和P4,以P2为端点作与P3所在直线垂直的第四垂线,判断所述第四垂线的垂足是否在所述P3所在直线上,若是,则以所述第四垂线的长度为墙体距离为内侧墙体距离,若否,则以P2与所述P3所在直线的端点的最小距离为内侧墙体距离。Preferably, if the third intersection object set includes P1, P2, P3 and P4, a fourth perpendicular line is drawn with P2 as the endpoint and perpendicular to the straight line where P3 is located, and it is determined whether the foot of the fourth perpendicular line is on the straight line where P3 is located. If so, the length of the fourth perpendicular line is taken as the wall distance and the inner wall distance; if not, the minimum distance between P2 and the endpoints of the straight line where P3 is located is taken as the inner wall distance.

优选的 ,若所述第三交点对象集合中包含P1、P2、P3和P4,以P2为端点作与P4所在直线垂直的第五垂线,判断所述第五垂线的垂足是否在所述P4所在直线上,若是,则以所述第五垂线的长度为墙体距离为内侧墙体至外侧墙体距离,若否,则以P2与所述P4所在直线的端点的最小距离为内侧墙体至外侧墙体距离。Preferably, if the third intersection object set includes P1, P2, P3 and P4, a fifth perpendicular line is drawn with P2 as the endpoint and perpendicular to the straight line where P4 is located, and it is determined whether the foot of the fifth perpendicular line is on the straight line where P4 is located. If so, the length of the fifth perpendicular line is used as the wall distance as the distance from the inner wall to the outer wall. If not, the minimum distance between P2 and the endpoints of the straight line where P4 is located is used as the distance from the inner wall to the outer wall.

优选的 ,若所述第三交点对象集合中包含以下元素外的任意情况,则结束流程:Preferably, if the third intersection object set contains any of the following elements, the process ends:

所述第三交点对象集合中仅包含P1和P2;The third intersection object set only includes P1 and P2;

所述第三交点对象集合中包含P1、P2、P3和P4。The third intersection object set includes P1, P2, P3 and P4.

本发明还提供了一种装置,所述装置用于实现上述CAD中墙体距离识别方法。The present invention also provides a device, which is used to implement the wall distance recognition method in the above CAD.

本发明还提供了一种存储介质,所述存储介质包括储存的程序,其中,所述程序运行时执行上述CAD中墙体距离识别方法。The present invention also provides a storage medium, which includes a stored program, wherein the program executes the above-mentioned wall distance recognition method in CAD when it is running.

本发明还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述CAD中墙体距离识别方法。The present invention also provides a processor, which is used to run a program, wherein the program executes the above-mentioned wall distance recognition method in CAD when running.

有益效果Beneficial Effects

1、本发明简化了CAD软件中距离标注和测量的操作流程,通过智能化识别和选择交点对象,用户无需在两条墙体线条上选择互相垂直的点进行测量,大大降低了操作的复杂度,特别是在处理线条繁复的图纸时,用户只需在图纸上选择两个点,系统即可自动完成后续的交点识别和距离计算,显著减少了手指触摸点与目标识别点之间的偏差,提升了测量的准确性。1. The present invention simplifies the operational process of distance marking and measurement in CAD software. By intelligently identifying and selecting intersection objects, users do not need to select mutually perpendicular points on two wall lines for measurement, which greatly reduces the complexity of the operation. Especially when dealing with drawings with complicated lines, users only need to select two points on the drawings, and the system can automatically complete the subsequent intersection recognition and distance calculation, which significantly reduces the deviation between the finger touch point and the target recognition point and improves the accuracy of the measurement.

2、本发明涵盖了外侧墙体距离、外侧墙体至内侧墙体距离、内侧墙体距离、内侧墙体至外侧墙体距离等多种测量需求,通过在交点对象集合中选择不同的交点对象,用户可以灵活应对不同的测量需求,提供全面的尺寸复核支持。2. The present invention covers various measurement requirements such as the distance between outer walls, the distance from outer walls to inner walls, the distance between inner walls, and the distance from inner walls to outer walls. By selecting different intersection objects in the intersection object set, users can flexibly respond to different measurement requirements and provide comprehensive dimension review support.

3、本发明通过自动化、智能化的识别和测量,提高了验收工作的效率,验收人员无需多次调整和手动操作,即可快速完成墙体距离的测量和复核,显著缩短了验收时间,提升了整体工作效率,并减少了因手动操作带来的人为误差。3. The present invention improves the efficiency of acceptance work through automated and intelligent identification and measurement. Acceptance personnel can quickly complete the measurement and verification of wall distances without multiple adjustments and manual operations, which significantly shortens the acceptance time, improves overall work efficiency, and reduces human errors caused by manual operations.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明一种较优实施例中提供的CAD中墙体距离识别方法的流程示意图;FIG1 is a schematic flow chart of a method for identifying wall distance in CAD provided in a preferred embodiment of the present invention;

图2为本发明一种较优实施例中在待识别CAD图纸上分别拾取点1和点2构成第一线段的示意图;FIG2 is a schematic diagram of picking up point 1 and point 2 on a CAD drawing to be identified to form a first line segment in a preferred embodiment of the present invention;

图3为本发明一种较优实施例中获得第二交点对象集合的示意图;FIG3 is a schematic diagram of obtaining a second intersection object set in a preferred embodiment of the present invention;

图4为本发明一种较优实施例中获得第三交点对象集合的示意图;FIG4 is a schematic diagram of obtaining a third intersection object set in a preferred embodiment of the present invention;

图5为本发明一种较优实施例中获得墙体距离的示意图一;FIG5 is a schematic diagram 1 of obtaining the wall distance in a preferred embodiment of the present invention;

图6为本发明另一种较优实施例中获得墙体距离的示意图二;FIG6 is a second schematic diagram of obtaining the wall distance in another preferred embodiment of the present invention;

图7为本发明一种较优实施例中获得外侧墙体距离的示意图一;FIG7 is a schematic diagram 1 of obtaining the outer wall distance in a preferred embodiment of the present invention;

图8为本发明另一种较优实施例中获得外侧墙体距离的示意图二;FIG8 is a second schematic diagram of obtaining the outer wall distance in another preferred embodiment of the present invention;

图9为本发明一种较优实施例中获得外侧墙体至内侧墙体距离的示意图一;FIG9 is a schematic diagram 1 of obtaining the distance from the outer wall to the inner wall in a preferred embodiment of the present invention;

图10为本发明另一种较优实施例中获得外侧墙体至内侧墙体距离的示意图二;FIG10 is a second schematic diagram of obtaining the distance from the outer wall to the inner wall in another preferred embodiment of the present invention;

图11为本发明一种较优实施例中获得内侧墙体距离的示意图一;FIG11 is a schematic diagram 1 of obtaining the inner wall distance in a preferred embodiment of the present invention;

图12为本发明另一种较优实施例中获得内侧墙体距离的示意图二;FIG12 is a second schematic diagram of obtaining the inner wall distance in another preferred embodiment of the present invention;

图13为本发明一种较优实施例中获得内侧墙体至外侧墙体距离的示意图一;FIG13 is a schematic diagram 1 of obtaining the distance from the inner wall to the outer wall in a preferred embodiment of the present invention;

图14为本发明另一种较优实施例中获得内侧墙体至外侧墙体距离的示意图二。FIG. 14 is a second schematic diagram of obtaining the distance from the inner wall to the outer wall in another preferred embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面结合附图对本发明作进一步阐述。在本发明的描述中,需要理解的是,术语“上”、“下”、“前”、“后”、“左”、“右”、“顶”、“底”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described below in conjunction with the accompanying drawings. In the description of the present invention, it should be understood that the terms "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention.

如图1所示,本实施例提供了一种CAD中墙体距离识别方法,包括步骤:As shown in FIG1 , this embodiment provides a method for identifying wall distance in CAD, comprising the steps of:

S1、读取待识别CAD图纸的图层信息。所属图层(Layer)是指在计算机辅助设计(CAD)软件绘图时所预设的包含至少一组参数的图形对象(线条、形状、文本和符号等)的集合,每个图层都有一个唯一的名称,用于标识和区分不同的图层。图层名称通常具有一定的描述性,以便清晰地表明该图层的内容或用途,本领域常用的有例如“墙体”、“电气”、“给排水”等。每个图层的颜色、线型、线宽和可见性等均可独立设置,以方便设计者可以更加高效地管理复杂的图纸内容,方便地进行查看、编辑和打印。在本发明中,通过读取图层信息,可以快速的选定关注的线条范围(如“墙体”),排除其他无关的线条。S1. Read the layer information of the CAD drawing to be identified. A layer (Layer) refers to a collection of graphic objects (lines, shapes, texts, symbols, etc.) that are preset when drawing in computer-aided design (CAD) software and contain at least one set of parameters. Each layer has a unique name for identifying and distinguishing different layers. The layer name is usually descriptive to a certain extent so as to clearly indicate the content or purpose of the layer. Commonly used names in this field include "wall", "electrical", "water supply and drainage", etc. The color, line type, line width, and visibility of each layer can be set independently to facilitate designers to manage complex drawing content more efficiently and to view, edit, and print conveniently. In the present invention, by reading the layer information, the range of lines of concern (such as "wall") can be quickly selected to exclude other irrelevant lines.

应当理解的是,本发明的方法在使用时优选的是作为CAD软件的第三方插件以提供额外的功能,因此在读取图层信息时可以利用CAD软件提供的编程接口(API)进行图层信息的访问和读取,其调用方式主要包括动态链接库(DLL)、ActiveX控件和.NET插件等方式,由于该部分内容不是本发明的关注重点,因此在此不再赘述,本领域技术人员可以根据现有技术自行选择进行图层信息读取的具体方式。It should be understood that the method of the present invention is preferably used as a third-party plug-in of CAD software to provide additional functions. Therefore, when reading layer information, the programming interface (API) provided by the CAD software can be used to access and read the layer information. The calling methods mainly include dynamic link libraries (DLLs), ActiveX controls, and .NET plug-ins. Since this part of the content is not the focus of the present invention, it will not be repeated here. Those skilled in the art can choose the specific method for reading layer information according to the existing technology.

S2、如图2所示,在所述待识别CAD图纸上分别拾取点1和点2,所述点1和所述点2间构成第一线段,所述第一线段与目标墙体相交。所述点1和点2位于目标识别区域内的任意位置,并且选择的位置需要确保构建的线段与目标墙体相交。S2. As shown in FIG2, point 1 and point 2 are picked up on the CAD drawing to be identified, respectively, and a first line segment is formed between point 1 and point 2, and the first line segment intersects with the target wall. Point 1 and point 2 are located at any position within the target identification area, and the selected position needs to ensure that the constructed line segment intersects with the target wall.

S3、在所述图层信息中查询与所述第一线段相交的所有直线,提取所有交点并计算所述交点与所述点1的第一距离,构建第一交点对象集合。S3. Query all straight lines intersecting the first line segment in the layer information, extract all intersection points, calculate the first distance between the intersection points and point 1, and construct a first intersection point object set.

S4、去除所述第一交点对象集合中所述第一距离相等的重复交点,获得第二交点对象集合,如图3所示。S4. Remove duplicate intersections with the same first distance from the first intersection object set to obtain a second intersection object set, as shown in FIG3 .

本领域技术人员可以知晓,在绘制建筑图纸时,由于绘制人员的误操作和软件构图的限制,往往导致某处线条或墙体的重复绘制,也即从显示出的效果看该处只有一根线条,而实际上该处可能重复了多根线条,而在CAD系统中,所有线条均为独立且唯一的,因此会导致在后续的距离计算步骤中,每根重复线条均被识别并计算一次,导致算力资源的浪费,为此,需要有上述的去重步骤。Those skilled in the art will know that when drawing architectural drawings, due to the drafting staff's misoperation and the limitations of the software composition, a line or wall is often drawn repeatedly. That is, from the displayed effect, there is only one line there, but in fact there may be multiple lines repeated there. In the CAD system, all lines are independent and unique. Therefore, in the subsequent distance calculation step, each repeated line is identified and calculated once, resulting in a waste of computing resources. For this reason, the above-mentioned deduplication step is required.

S5、如图4所示,在所述第二交点对象集合中依次选择所述第一距离最小、最大、次小、次大的交点对象P1、P2、P3和P4,构建第三交点对象集合。应当说明的是,本领域的技术人员在进行墙体距离测量时,有四种测量需求,分别为墙体外侧之间的距离(外侧墙体距离)、墙体外侧与另一墙体内侧之间的距离(外侧墙体至内侧墙体距离)、墙体内侧之间的距离(内侧墙体距离)和墙体内侧与另一墙体外侧之间的距离(内侧墙体至外侧墙体距离)。而该步骤中的交点对象选择依据的就是这四种需求。S5. As shown in FIG4 , in the second intersection object set, the intersection objects P1, P2, P3 and P4 with the smallest, largest, second smallest and second largest first distances are selected in turn to construct a third intersection object set. It should be noted that when measuring the distance between walls, technicians in this field have four measurement requirements, namely, the distance between the outer sides of the walls (outer wall distance), the distance between the outer side of the wall and the inner side of another wall (outer wall to inner wall distance), the distance between the inner sides of the walls (inner wall distance) and the distance between the inner side of the wall and the outer side of another wall (inner wall to outer wall distance). The selection of intersection objects in this step is based on these four requirements.

S6、若所述第三交点对象集合中仅包含P1和P2,说明相交的只有两条直线,此时这种情况一般是在墙体内部选择了两个端点,则以P1为端点作与P2所在直线垂直的第一垂线,判断所述第一垂线的垂足是否在所述P2所在直线上,若是,如图5所示,则以所述第一垂线的长度为墙体距离,若否,如图6所示,则以P1与所述P2所在直线的端点的最小距离为墙体距离。S6. If the third intersection object set only includes P1 and P2, it means that there are only two intersecting straight lines. In this case, two endpoints are generally selected inside the wall. Then, with P1 as the endpoint, draw a first perpendicular line perpendicular to the straight line where P2 is located, and determine whether the foot of the first perpendicular line is on the straight line where P2 is located. If so, as shown in Figure 5, the length of the first perpendicular line is the wall distance. If not, as shown in Figure 6, the minimum distance between P1 and the endpoints of the straight line where P2 is located is the wall distance.

对于不存在相互垂线的两段墙体,此时若按照CAD软件内置的距离测量工具其会自动延长其中的一段墙体线,进而寻找垂足然后计算距离,但这样的操作显然与现场的实际情况不符,因为实际的墙体显然是不可能被任意延长的。因此,本发明选择所述P2所在直线上与P1最接近的一端端点的距离作为墙体距离。For two wall sections that do not have a perpendicular line to each other, if the distance measurement tool built into the CAD software is used, one of the wall sections will be automatically extended, and then the foot of the perpendicular will be found and the distance will be calculated. However, such an operation is obviously inconsistent with the actual situation on site, because the actual wall cannot be extended arbitrarily. Therefore, the present invention selects the distance between the end point closest to P1 on the straight line where P2 is located as the wall distance.

在另一些较优的实施例中,还给出了一种测量墙体外侧之间距离的实现方式,具体包括:In some other preferred embodiments, a method for measuring the distance between the outer sides of the walls is also provided, which specifically includes:

S7、若所述第三交点对象集合中包含P1、P2、P3和P4,以P1为端点作与P4所在直线垂直的第二垂线,判断所述第二垂线的垂足是否在所述P4所在直线上,若是,如图7所示,则以所述第二垂线的长度为墙体距离为外侧墙体距离,若否,如图8所示,则以P1与所述P4所在直线的端点的最小距离为外侧墙体距离。S7. If the third intersection object set includes P1, P2, P3 and P4, draw a second perpendicular line with P1 as the endpoint and perpendicular to the straight line where P4 is located, and determine whether the foot of the second perpendicular line is on the straight line where P4 is located. If so, as shown in Figure 7, the length of the second perpendicular line is used as the wall distance and the outer wall distance. If not, as shown in Figure 8, the minimum distance between P1 and the endpoints of the straight line where P4 is located is used as the outer wall distance.

在另一些较优的实施例中,还给出了一种测量墙体外侧之间距离的实现方式,具体包括:In some other preferred embodiments, a method for measuring the distance between the outer sides of the walls is also provided, which specifically includes:

若所述第三交点对象集合中包含P1、P2、P3和P4,以P1为端点作与P3所在直线垂直的第三垂线,判断所述第三垂线的垂足是否在所述P3所在直线上,若是,如图9所示,则以所述第三垂线的长度为墙体距离为外侧墙体至内侧墙体距离,若否,如图10所示,则以P1与所述P3所在直线的端点的最小距离为外侧墙体至内侧墙体距离。If the third intersection object set includes P1, P2, P3 and P4, draw a third perpendicular line with P1 as the endpoint and perpendicular to the straight line where P3 is located, and determine whether the foot of the third perpendicular line is on the straight line where P3 is located. If so, as shown in Figure 9, the length of the third perpendicular line is used as the wall distance as the distance from the outer wall to the inner wall. If not, as shown in Figure 10, the minimum distance between P1 and the endpoints of the straight line where P3 is located is used as the distance from the outer wall to the inner wall.

在另一些较优的实施例中,还给出了一种测量墙体外侧之间距离的实现方式,具体包括:In some other preferred embodiments, a method for measuring the distance between the outer sides of the walls is also provided, which specifically includes:

若所述第三交点对象集合中包含P1、P2、P3和P4,以P2为端点作与P3所在直线垂直的第四垂线,判断所述第四垂线的垂足是否在所述P3所在直线上,若是,如图11所示,则以所述第四垂线的长度为墙体距离为内侧墙体距离,若否,如图12所示,则以P2与所述P3所在直线的端点的最小距离为内侧墙体距离。If the third intersection object set includes P1, P2, P3 and P4, draw a fourth perpendicular line with P2 as the endpoint and perpendicular to the straight line where P3 is located, and determine whether the foot of the fourth perpendicular line is on the straight line where P3 is located. If so, as shown in Figure 11, the length of the fourth perpendicular line is used as the wall distance and the inner wall distance. If not, as shown in Figure 12, the minimum distance between P2 and the endpoints of the straight line where P3 is located is used as the inner wall distance.

在另一些较优的实施例中,还给出了一种测量墙体外侧之间距离的实现方式,具体包括:In some other preferred embodiments, a method for measuring the distance between the outer sides of the walls is also provided, which specifically includes:

若所述第三交点对象集合中包含P1、P2、P3和P4,以P2为端点作与P4所在直线垂直的第五垂线,判断所述第五垂线的垂足是否在所述P4所在直线上,若是,如图13所示,则以所述第五垂线的长度为墙体距离为内侧墙体至外侧墙体距离,若否,如图14所示,则以P2与所述P4所在直线的端点的最小距离为内侧墙体至外侧墙体距离。If the third intersection object set includes P1, P2, P3 and P4, draw a fifth perpendicular line with P2 as the endpoint and perpendicular to the straight line where P4 is located, and determine whether the foot of the fifth perpendicular line is on the straight line where P4 is located. If so, as shown in Figure 13, the length of the fifth perpendicular line is used as the wall distance as the distance from the inner wall to the outer wall. If not, as shown in Figure 14, the minimum distance between P2 and the endpoints of the straight line where P4 is located is used as the distance from the inner wall to the outer wall.

在另一些较优的实施例中,考虑由于用户在选点时可能由于误操作导致不存在与目标墙体相交的线段,或相交线段的交点所在墙体存在交叉或垂直的情况,此时,若不限定流程的结束条件,会存在程序报错甚至陷入无限循环的计算中,因此,本实施例考虑设定流程的终止条件,具体包括:In other preferred embodiments, it is considered that there is no line segment intersecting with the target wall due to misoperation by the user when selecting a point, or the wall where the intersection of the intersecting line segment is located is intersecting or perpendicular. At this time, if the end condition of the process is not limited, there will be a program error or even fall into an infinite loop calculation. Therefore, this embodiment considers setting the termination condition of the process, which specifically includes:

若所述第三交点对象集合中包含以下元素外的任意情况,则结束流程:If the third intersection object set contains any of the following elements, the process ends:

1、所述第三交点对象集合中仅包含P1和P2;1. The third intersection object set only includes P1 and P2;

2、所述第三交点对象集合中包含P1、P2、P3和P4。2. The third intersection object set includes P1, P2, P3 and P4.

也即出现本发明所限定的两个条件以外的任何交点集合情况,均被排除在流程以外,以防止出现错误,并节约算力资源。如此设置的技术考虑如下:1、交点对象集合中的元素不能是奇数,因为奇数个元素代表墙体同样为奇数,此时无法直接确定墙体厚度,因此在实际应用中意义不大。2、必须是偶数个点,也即上述的存在2个元素和4个元素的情况。That is, any intersection point set other than the two conditions specified by the present invention is excluded from the process to prevent errors and save computing resources. The technical considerations for such a setting are as follows: 1. The elements in the intersection point object set cannot be an odd number, because an odd number of elements represents an odd number of walls, and the wall thickness cannot be directly determined at this time, so it is not very meaningful in practical applications. 2. There must be an even number of points, that is, the above-mentioned situation of 2 elements and 4 elements.

以上显示和描述了本发明的基本原理、主要特征和本发明的优点。本行业的技术人员应该了解,本发明不受上述实施例的限制,上述实施例和说明书中描述的只是说明本发明的原理,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内。本发明要求保护范围由所附的权利要求书及其等效物界定。The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims (9)

  1. The wall distance identification method in CAD is characterized by comprising the following steps:
    Reading layer information of a CAD drawing to be identified;
    Respectively picking up a point 1 and a point 2 on the CAD drawing to be identified, wherein a first line segment is formed between the point 1 and the point 2, and the first line segment is intersected with a target wall body;
    Querying all straight lines intersecting the first line segment in the layer information, extracting all intersection points, calculating a first distance between the intersection points and the point 1, and constructing a first intersection point object set;
    removing repeated intersection points with equal first distances in the first intersection point object set to obtain a second intersection point object set;
    Sequentially selecting intersection point objects P1, P2, P3 and P4 with the minimum, maximum, secondary minimum and secondary maximum of the first distance from the second intersection point object set, and constructing a third intersection point object set;
    If the third intersection object set only comprises P1 and P2, taking P1 as an endpoint to make a first vertical line perpendicular to a straight line where P2 is located, judging whether the foot of the first vertical line is on the straight line where P2 is located, if so, taking the length of the first vertical line as a wall distance, and if not, taking the minimum distance between P1 and the endpoint of the straight line where P2 is located as the wall distance.
  2. 2. The method for identifying wall distance in CAD of claim 1, further comprising the steps of:
    If the third intersection object set includes P1, P2, P3 and P4, taking P1 as an end point to make a second vertical line perpendicular to the straight line where P4 is located, judging whether the foot of the second vertical line is on the straight line where P4 is located, if so, taking the length of the second vertical line as the wall distance as the outer wall distance, and if not, taking the minimum distance between the end points of the straight line where P1 and P4 are located as the outer wall distance.
  3. 3. The method for identifying wall distance in CAD of claim 1, further comprising the steps of:
    If the third intersection object set includes P1, P2, P3 and P4, taking P1 as an endpoint to make a third vertical line perpendicular to the straight line where P3 is located, judging whether the foot of the third vertical line is on the straight line where P3 is located, if so, taking the length of the third vertical line as the distance from the wall body to the outside wall body, and if not, taking the minimum distance between the endpoint of the straight line where P1 and P3 are located as the distance from the outside wall body to the inside wall body.
  4. 4. The method for identifying wall distance in CAD of claim 1, further comprising the steps of:
    if the third intersection object set includes P1, P2, P3 and P4, taking P2 as an endpoint to make a fourth vertical line perpendicular to the straight line where P3 is located, judging whether the foot of the fourth vertical line is on the straight line where P3 is located, if so, taking the length of the fourth vertical line as the wall distance as the inner wall distance, and if not, taking the minimum distance between the endpoint of the straight line where P2 and P3 are located as the inner wall distance.
  5. 5. The method for identifying wall distance in CAD of claim 1, further comprising the steps of:
    If the third intersection object set includes P1, P2, P3 and P4, taking P2 as an endpoint to make a fifth vertical line perpendicular to the straight line where P4 is located, judging whether the foot of the fifth vertical line is on the straight line where P4 is located, if so, taking the length of the fifth vertical line as the distance from the inner wall to the outer wall, and if not, taking the minimum distance between the endpoint of the straight line where P2 and P4 are located as the distance from the inner wall to the outer wall.
  6. 6. The method for identifying wall distance in CAD of claim 1, further comprising the steps of:
    If the third intersection object set includes any case except the following elements, ending the flow:
    the third intersection point object set only comprises P1 and P2;
    The third intersection object set includes P1, P2, P3 and P4.
  7. 7. An apparatus for implementing the method of any one of claims 1 to 6.
  8. 8. A storage medium comprising a stored program, wherein the program when run performs the method of any one of claims 1 to 6.
  9. 9. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 6.
CN202410883167.0A 2024-07-03 2024-07-03 Wall distance identification method and device in CAD, storage medium and processor Active CN118427950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410883167.0A CN118427950B (en) 2024-07-03 2024-07-03 Wall distance identification method and device in CAD, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410883167.0A CN118427950B (en) 2024-07-03 2024-07-03 Wall distance identification method and device in CAD, storage medium and processor

Publications (2)

Publication Number Publication Date
CN118427950A true CN118427950A (en) 2024-08-02
CN118427950B CN118427950B (en) 2024-12-06

Family

ID=92321854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410883167.0A Active CN118427950B (en) 2024-07-03 2024-07-03 Wall distance identification method and device in CAD, storage medium and processor

Country Status (1)

Country Link
CN (1) CN118427950B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5299307A (en) * 1990-08-17 1994-03-29 Claris Corporation Controls for drawing images on computer displays
JP2001282875A (en) * 2000-03-30 2001-10-12 Toyota Motor Corp A method for extracting feature points and classifying categories from side profile description data of automobiles
US20080065346A1 (en) * 2006-09-08 2008-03-13 Dmitry Shkipin System and Method for Measurement of Existing Structures with Known or Assumed to be Known Geometrical Properties
US20140314276A1 (en) * 2013-01-07 2014-10-23 Wexenergy Innovations Llc System and method of measuring distances related to an object
CN105205198A (en) * 2014-06-30 2015-12-30 上海神机软件有限公司 Full-automatic intelligent integrated formwork arranging system and method for construction engineering fabricated formworks
JP2019139756A (en) * 2018-02-09 2019-08-22 广州大学 Veranda automatic recognition method based on architecture drawing
CN111539064A (en) * 2020-03-30 2020-08-14 中车青岛四方机车车辆股份有限公司 Midline and thickness extraction method and finite element mesh automatic generation method
CN111754535A (en) * 2020-06-23 2020-10-09 自然资源部四川测绘产品质量监督检验站(四川省测绘产品质量监督检验站) Airborne laser point cloud overlapping degree detection method and system
JP2020173211A (en) * 2019-04-12 2020-10-22 俊雄 川口 Angle measuring device, distance measuring device, speed measuring device, altitude measuring device, coordinate measuring device, angle measuring method, and program
CN114494719A (en) * 2022-01-07 2022-05-13 上海品览数据科技有限公司 Method for identifying bedroom space depth space in building major

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5299307A (en) * 1990-08-17 1994-03-29 Claris Corporation Controls for drawing images on computer displays
JP2001282875A (en) * 2000-03-30 2001-10-12 Toyota Motor Corp A method for extracting feature points and classifying categories from side profile description data of automobiles
US20080065346A1 (en) * 2006-09-08 2008-03-13 Dmitry Shkipin System and Method for Measurement of Existing Structures with Known or Assumed to be Known Geometrical Properties
US20140314276A1 (en) * 2013-01-07 2014-10-23 Wexenergy Innovations Llc System and method of measuring distances related to an object
CN105205198A (en) * 2014-06-30 2015-12-30 上海神机软件有限公司 Full-automatic intelligent integrated formwork arranging system and method for construction engineering fabricated formworks
JP2019139756A (en) * 2018-02-09 2019-08-22 广州大学 Veranda automatic recognition method based on architecture drawing
JP2020173211A (en) * 2019-04-12 2020-10-22 俊雄 川口 Angle measuring device, distance measuring device, speed measuring device, altitude measuring device, coordinate measuring device, angle measuring method, and program
CN111539064A (en) * 2020-03-30 2020-08-14 中车青岛四方机车车辆股份有限公司 Midline and thickness extraction method and finite element mesh automatic generation method
CN111754535A (en) * 2020-06-23 2020-10-09 自然资源部四川测绘产品质量监督检验站(四川省测绘产品质量监督检验站) Airborne laser point cloud overlapping degree detection method and system
CN114494719A (en) * 2022-01-07 2022-05-13 上海品览数据科技有限公司 Method for identifying bedroom space depth space in building major

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"CAD平行线之间的间距怎么标注", Retrieved from the Internet <URL:https://www.zzzcad.com/autocadjiaocheng/7742.html> *
宋丛丽;: "轨道交通车辆段综合管线软碰撞算法及实现", 铁路计算机应用, no. 04, 25 April 2015 (2015-04-25) *

Also Published As

Publication number Publication date
CN118427950B (en) 2024-12-06

Similar Documents

Publication Publication Date Title
TW569150B (en) A system and method for analyzing and processing measurement data
CN111260413B (en) A quick cost calculation method for power main network engineering construction drawings based on vector graphics
CN110334390B (en) Method and device for identifying outer wall in computer-aided design (CAD), storage medium and processor
CN111400899A (en) Processing method, system and storage medium for cable laying modeling
CN113326558B (en) Rapid drawing method for detailed diagrams of parameterized doors and windows based on Grasshopper platform secondary development
WO2018228049A1 (en) Database performance index monitoring method, apparatus and device, and storage medium
CN115455521A (en) Method, device, equipment and storage medium for generating system diagram of water supply and drainage machine room
CN112307408A (en) Method and device for determining element information in page, electronic equipment and storage medium
WO2024109959A1 (en) Three-dimensional automatic design method and apparatus for trays and bearers in gallery, and medium and device
CN114077600B (en) ARM (advanced RISC machine) kernel-based data heterogeneous migration visual analysis method
CN109269424A (en) A kind of test specimen mark point position precision detection device and method
CN106548278A (en) A kind of high standard capital farmland construction Project Areas preferably automatedization computational methods
CN115510520A (en) Beam reinforcement view editing method, device and equipment and storage medium
CN109766601B (en) Computer aided drawing method and device for electric piping
CN118427950A (en) Wall distance recognition method, device, storage medium and processor in CAD
CN118410346A (en) A method for intelligent processing of construction project list data
CN118643566A (en) BIM model verification method, system and storage medium
CN116431839B (en) Regional network generation method, system, computer equipment and storage medium
CN116663100A (en) Engineering data calling method and system based on intelligent construction technology
CN107861931A (en) Template file processing method, device, computer equipment and storage medium
CN115577424A (en) Method, device, equipment and storage medium for calculating construction engineering quantity
CN119540472B (en) Fusion-driven three-dimensional model extreme speed construction method, device and program product
TWI821027B (en) Component matching and reporting method
CN117114782B (en) Construction engineering cost analysis method
CN118377555B (en) Method, device and equipment for constructing artificial intelligent model and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant