Search

CN-115272605-B - Method, device, equipment and storage medium for picking up three-dimensional model component

CN115272605BCN 115272605 BCN115272605 BCN 115272605BCN-115272605-B

Abstract

The invention discloses a picking method of a three-dimensional model component, which comprises the steps of constructing a detection ray based on a picking point position, determining whether the detection ray is intersected with the three-dimensional model component to be picked, acquiring a first model sub-component group of the three-dimensional model component to be picked according to a preset rule if the detection ray is not intersected with the three-dimensional model component to be picked, projecting the first model sub-component group to a display plane to obtain a second model sub-component group, determining whether the distance between the picking point position in the display plane and at least one sub-component in the second model sub-component group is smaller than a preset threshold value, and picking the three-dimensional model component to be picked if the distance between the picking point position in the display plane and at least one sub-component in the second model sub-component group is smaller than the preset threshold value. The method and the device can pick up the three-dimensional model within a preset pixel distance range from the click position of the mouse by utilizing the mode of combining the ray detection method with the screen projection method, so that the accuracy of picking up the three-dimensional model by a user is improved, and the operation difficulty is reduced.

Inventors

  • You Yongmin
  • Request for anonymity

Assignees

  • 久瓴(江苏)数字智能科技有限公司

Dates

Publication Date
20260505
Application Date
20210429

Claims (10)

  1. 1. A method of picking up a three-dimensional model member, the method comprising: constructing a detection ray based on the pick-up point position, and determining whether the detection ray intersects with a three-dimensional model member to be picked up; if the detected ray is determined to intersect with the three-dimensional model member to be picked up, picking up the three-dimensional model member to be picked up; If the detection rays are not intersected with the three-dimensional model component to be picked up, acquiring a first model sub-component group of the three-dimensional model component to be picked up according to a preset rule and index data of the three-dimensional model component to be picked up, wherein when the three-dimensional model component to be picked up comprises three-dimensional model sub-components except point-shaped sub-components or linear sub-components, the first model sub-component group comprises a combination of linear sub-components with two vertexes formed after the three-dimensional model component to be picked up is split according to the index data; Projecting the first set of model sub-components to a display plane to obtain a second set of model sub-components; Determining whether a distance between a pick-up point location in the display plane and at least one sub-member of the second set of model sub-members is less than a preset threshold value, and And if the distance between the position of the picking point in the display plane and at least one sub-component in the second model sub-component group is smaller than a preset threshold value, picking up the three-dimensional model component to be picked up.
  2. 2. The method of picking up a three-dimensional model member according to claim 1, wherein the determining whether the detected ray intersects a three-dimensional model member to be picked up further comprises: Judging whether the three-dimensional model component to be picked up has a bounding box or not; If the bounding box exists in the three-dimensional model component to be picked up, acquiring the bounding box and judging whether the detection ray intersects with the bounding box or not, and And if the three-dimensional model component to be picked up does not have a bounding box, or the three-dimensional model component to be picked up has a bounding box but the detection ray is not intersected with the bounding box, determining that the detection ray is not intersected with the three-dimensional model component to be picked up.
  3. 3. The pickup method of a three-dimensional model member according to claim 2, wherein it is judged that the three-dimensional model member to be picked up does not have a bounding box if at least one of: the three-dimensional model member to be picked up is a dot-shaped member having a single vertex, or In the case where the three-dimensional model member to be picked up is a linear member having two vertices, the linear member is parallel to at least one plane of a preset plurality of planes.
  4. 4. The method for picking up a three-dimensional model member according to claim 2, wherein the method further comprises judging whether a polygon composed of vertex lines of the three-dimensional model member to be picked up intersects with the detection ray in a case where the bounding box exists and it is judged that the detection ray intersects with the bounding box.
  5. 5. The method for picking up a three-dimensional model member according to claim 4, wherein determining whether a polygon formed by connecting lines of vertices of the three-dimensional model member to be picked up intersects the detection ray includes determining whether triangles formed by connecting lines of any three vertices of the three-dimensional model member to be picked up intersect the detection ray, and determining that the detection ray does not intersect the three-dimensional model member to be picked up if all triangles formed by connecting lines of any three vertices do not intersect the detection ray.
  6. 6. The method for picking up a three-dimensional model member according to claim 1, wherein, When the three-dimensional model member to be picked up comprises only a punctiform sub-member with a single apex or a linear sub-member with two apexes, the first set of model sub-members is the punctiform sub-member or the linear sub-member, respectively.
  7. 7. A pick-up device for a three-dimensional model member, the device comprising: The acquisition module is used for acquiring a first model sub-component group of the three-dimensional model component to be picked up according to a preset rule and index data of the three-dimensional model component to be picked up under the condition that the detection ray is not intersected with the three-dimensional model component to be picked up, wherein the detection ray is constructed based on a pick-up point; a projection module for projecting the first model sub-component group to a display plane to obtain a second model sub-component group, and A determining module, configured to pick up the three-dimensional model member to be picked up when it is determined that a distance between a pick-up point position in the display plane and at least one of the second model sub-members is smaller than a preset threshold value, or when it is determined that the detection ray intersects the three-dimensional model member to be picked up.
  8. 8. The apparatus for picking up a three-dimensional model member according to claim 7, further comprising a judging module for constructing a detection ray based on the pick-up point position and determining whether the detection ray intersects the three-dimensional model member to be picked up.
  9. 9. A computer device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method according to any of claims 1 to 7.
  10. 10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, realizes the steps in the picking method of a three-dimensional model member according to any one of claims 1 to 7.

Description

Method, device, equipment and storage medium for picking up three-dimensional model component Technical Field The invention relates to the technical field of building informatization, in particular to a method, a device, equipment and a storage medium for picking up a three-dimensional model component. Background Building Information Model (BIM) is a new tool for architecture, engineering and civil engineering to represent three-dimensional graphics-based, object-oriented, architecture-related computer-aided design. BIM technology plays an important role in improving production efficiency, saving cost and shortening construction period through the data and information model integration of the building. The method has the five characteristics of visualization, coordination, simulation, optimality and diagrammability. WebGL is a 3D drawing protocol that can enable smoother presentation of 3D scenes and building information models in a browser without the support of browser plug-ins. The WebGL-based BIM engine needs to pick up and operate the BIM model according to mouse clicks when displaying the BIM model. And when the user has willing to click, but the mouse position is close but not completely in the screen pixel range of the BIM model, the target model cannot be selected. Disclosure of Invention Aiming at the defects in the prior art, the invention provides a method, a device, equipment and a storage medium for picking up a three-dimensional model component, which can pick up the three-dimensional model within a preset pixel distance range from a mouse click position by utilizing a mode of combining a ray detection method with a screen projection method, so as to improve the accuracy of picking up the three-dimensional model by a user and reduce the operation difficulty. To achieve the above object, an embodiment of the present invention provides a picking method of a three-dimensional model member, the method including constructing a detection ray based on a picking point position and determining whether the detection ray intersects a three-dimensional model member to be picked up, acquiring a first model sub-member group of the three-dimensional model member to be picked up according to a preset rule if it is determined that the detection ray does not intersect the three-dimensional model member to be picked up, projecting the first model sub-member group to a display plane to obtain a second model sub-member group, determining whether a distance between a picking point position in the display plane and at least one sub-member in the second model sub-member group is less than a preset threshold, and picking up the three-dimensional model member to be picked up if a distance between a picking point position in the display plane and at least one sub-member in the second model sub-member group is less than a preset threshold. The determining whether the detection ray intersects with the three-dimensional model member to be picked up further comprises judging whether a bounding box exists in the three-dimensional model member to be picked up, acquiring the bounding box and judging whether the detection ray intersects with the bounding box if the bounding box exists in the three-dimensional model member to be picked up, and determining that the detection ray does not intersect with the three-dimensional model member to be picked up if the bounding box does not exist in the three-dimensional model member to be picked up or the bounding box exists in the three-dimensional model member to be picked up but the detection ray does not intersect with the bounding box. Further, if at least one of the three-dimensional model member to be picked up is judged to have no bounding box, the three-dimensional model member to be picked up is a dot-shaped member having a single vertex, or if the three-dimensional model member to be picked up is a linear member having two vertices, the linear member is parallel to at least one plane of a preset plurality of planes. The method further comprises the step of judging whether a polygon formed by vertex connecting lines of the three-dimensional model component to be picked up is intersected with the detection ray or not under the condition that the bounding box exists and the detection ray is intersected with the bounding box. Judging whether the polygon formed by the connecting lines of the vertexes of the three-dimensional model component to be picked up is intersected with the detection ray or not comprises judging whether the triangle formed by the connecting lines of any three vertexes of the three-dimensional model component to be picked up is intersected with the detection ray or not, and if all the triangles formed by the connecting lines of any three vertexes are not intersected with the detection ray, determining that the detection ray is not intersected with the three-dimensional model component to be picked up. The method for acquiring the first model sub-component grou