CN115688497B - Load graphic element display method and device, electronic equipment and storage medium - Google Patents

Load graphic element display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115688497B
CN115688497B CN202310010569.5A CN202310010569A CN115688497B CN 115688497 B CN115688497 B CN 115688497B CN 202310010569 A CN202310010569 A CN 202310010569A CN 115688497 B CN115688497 B CN 115688497B
Authority
CN
China
Prior art keywords
target
vector
determining
line segment
points
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.)
Active
Application number
CN202310010569.5A
Other languages
Chinese (zh)
Other versions
CN115688497A (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.)
Pera Corp Ltd
Original Assignee
Pera Corp Ltd
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 Pera Corp Ltd filed Critical Pera Corp Ltd
Priority to CN202310010569.5A priority Critical patent/CN115688497B/en
Publication of CN115688497A publication Critical patent/CN115688497A/en
Application granted granted Critical
Publication of CN115688497B publication Critical patent/CN115688497B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The application relates to a method and a device for displaying a load graphic element, electronic equipment and a storage medium, wherein the method comprises the following steps: determining a plurality of target points from the inside of a grid surface to which a load is to be applied and the boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points; converting the multiple target points into a target coordinate system respectively, and determining a normal vector of the boundary line according to the multiple target points after coordinate conversion; and determining the display pose of the load graphic element according to the normal vector of the edge line so as to display the load graphic element. According to the scheme, one coordinate axis of the target coordinate system is determined by the normal vector common to the target points, after the target points are subjected to coordinate conversion, the coordinate values of one dimension are zero, the normal vector of the boundary line can be conveniently determined in a two-dimensional scene, and the efficiency and the reliability of the load primitive determining process are improved.

Description

Load graphic element display method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of electronic digital data processing technologies, and in particular, to a method and apparatus for displaying a load primitive, an electronic device, and a storage medium.
Background
In a graphic simulation process, it may involve applying a load to the simulated graphic, which will be presented to the user in the form of a load primitive.
In the related art, for the load defined on the grid surface edge line of the simulation graph, the determination mode of the load graphic element is complicated, and the load graphic element cannot be efficiently and accurately presented to the user, so that the reliability of the graph simulation process is affected.
Disclosure of Invention
In order to solve or partially solve the problems existing in the related art, the application provides a method, a device, electronic equipment and a storage medium for displaying a load graphic element, which can effectively and accurately determine and display the load graphic element according to the normal vector of a grid surface edge.
The first aspect of the present application provides a method for displaying a load primitive, where the method includes:
determining a plurality of target points from the inside of a grid surface to which a load is to be applied and a boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points;
converting the target points into the target coordinate system respectively, and determining normal vectors of the boundary according to the target points after coordinate conversion;
and determining the display pose of the load graphic element according to the normal vector of the side line so as to display the load graphic element.
According to the method for displaying the load primitive provided by the application, the determining a plurality of target points from the interior of the grid surface to which the load is to be applied and the edge comprises the following steps:
determining a geometric center point corresponding to the grid surface from the inside of the grid surface;
determining a target line segment from the side line, and determining a plurality of line segment key points of the target line segment; the target line segment is used for representing the area where the load to be applied is located at the action position of the side line.
According to the method for displaying the load graphic element provided by the application, the edge line comprises a plurality of edge line segments, and the determining of the target line segment from the edge line comprises the following steps:
determining a communication ring which contains partial edge line segments and has the largest number of edge line segments from the grid surface to obtain a target communication ring;
extracting edge line segments contained in the target communication ring from the edge line to construct an edge line segment set;
the target line segment is determined from the set of edge line segments.
According to the method for displaying the load primitive provided by the application, the determining the target line segment from the edge line segment set includes:
and extracting an edge line segment positioned at or close to the middle position from the edge line segment set to obtain a target line segment.
According to the method for displaying the load primitive provided by the application, the target coordinate system is established according to the plurality of target points, and the method comprises the following steps:
determining a target plane according to at least three target points in the plurality of target points, and determining a normal vector of the target plane, wherein the at least three target points comprise at least one point positioned inside the grid surface and at least two points positioned on the side line; and establishing a target coordinate system according to the target points and the normal vector of the target plane.
According to the method for displaying the load graphic primitive, the plurality of target points comprise a plurality of line segment key points corresponding to the target line segments of the side lines, and the plurality of line segment key points comprise line segment end points and line segment midpoints;
the establishing a target coordinate system according to the target points and the normal vector of the target plane comprises the following steps:
taking the midpoint of the line segment as an origin, taking a vector determined from the origin to any line segment endpoint as an x-axis, taking a normal vector of the target plane as a z-axis, and determining a y-axis according to a cross product of the x-axis and the z-axis;
and establishing the target coordinate system according to the x-axis, the y-axis and the z-axis.
According to the method for displaying the load primitive provided by the application, the determining the normal vector of the boundary line according to the plurality of target points after coordinate transformation includes:
according to at least three target points in the plurality of target points after coordinate conversion, respectively determining a first vector and a second vector, wherein the at least three target points comprise at least one point positioned in the grid surface and at least two points positioned on the side line; and determining the normal vector of the side line according to the first vector and the second vector.
According to the method for displaying the load graphic primitive, the at least three target points comprise geometric center points of the grid surface and a plurality of line segment key points corresponding to target line segments positioned on the side lines, wherein the line segment key points comprise line segment end points and line segment midpoints;
the determining the first vector and the second vector according to at least three target points in the plurality of target points after coordinate conversion includes:
determining a first vector according to the midpoint of the line segment and any line segment end point after coordinate conversion;
and determining a second vector according to the geometric center point and the line segment midpoint after coordinate conversion.
According to the method for displaying the load primitive provided by the application, the determining the normal vector of the edge according to the first vector and the second vector comprises the following steps:
rotating the first vector forward or backward by a specific angle to obtain a third vector;
and determining an included angle between the third vector and the second vector, and determining a normal vector of the side line according to the corresponding third vector when the included angle is larger than a preset angle threshold.
A second aspect of the present application provides a display device for a load primitive, the device comprising:
the first processing module is used for determining a plurality of target points from the inside of a grid surface to which a load is to be applied and the boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points;
the second processing module is used for respectively converting the plurality of target points into the target coordinate system and determining the normal vector of the boundary line according to the plurality of target points after coordinate conversion;
and the third processing module is used for determining the display pose of the load graphic primitive according to the normal vector of the edge line so as to display the load graphic primitive.
A third aspect of the present application provides an electronic device, comprising:
a processor; and
a memory having executable code stored thereon which, when executed by the processor, causes the processor to perform the method as described above.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon executable code which, when executed by a processor of an electronic device, causes the processor to perform a method as described above.
The technical scheme that this application provided can include following beneficial effect:
the method comprises the steps of determining a plurality of target points from the inside of a grid surface to which a load is to be applied and a boundary, establishing a target coordinate system according to the plurality of target points, respectively converting the plurality of target points into the target coordinate system, determining normal vectors of the boundary according to the plurality of target points after coordinate conversion, and further determining display positions of load primitives according to normal vectors of the boundary, so that the load primitives are accurately displayed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular descriptions of exemplary embodiments of the application as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout the exemplary embodiments of the application.
FIG. 1 is a flow chart of a method for displaying a load primitive according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a combination of edge line segments on the edges of a mesh surface according to an embodiment of the present application;
FIG. 3 is a schematic diagram of the location of a target line segment on an elliptical mesh surface in an embodiment of the present application;
FIG. 4 is a schematic view of the structure of a target plane in an embodiment of the present application;
FIG. 5 is a schematic diagram of the structure of the target coordinate system in the embodiment of the present application;
FIG. 6 is a schematic diagram of the positions of the first vector, the second vector, and the normal vector of the edge in an embodiment of the present application;
FIG. 7 is a schematic diagram of a display state of a load primitive corresponding to a pressure load;
fig. 8 is a schematic structural diagram of a display device of a load primitive shown in an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The embodiment of the application relates to the field of electric digital data processing, and particularly can be applied to a graphic simulation scene, such as a situation of applying load on grid surface edges of a simulation graphic.
In the simulation link, the load is presented to the user in the form of a load graphic primitive, the determination process of the load graphic primitive is complex in the related art, the related calculation amount is large, and the load graphic primitive is difficult to be presented to the user efficiently and accurately, so that the reliability of the graphic simulation process is affected.
Aiming at the problems, the embodiment of the application provides a display method of a load graphic primitive, which can more conveniently determine the pose of the load graphic primitive and realize high-efficiency and accurate display of the load graphic primitive.
The following describes in detail the method, the device, the electronic device, and the technical solution of the storage medium for displaying the load primitive provided in the embodiments of the present application with reference to fig. 1 to 9.
Fig. 1 is a flow chart of a method for displaying a load primitive according to an embodiment of the present application.
Referring to fig. 1, a method for displaying a load primitive provided in an embodiment of the present application specifically includes:
step 101: determining a plurality of target points from the inside of a grid surface to which a load is to be applied and the boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points;
step 102: converting the multiple target points into a target coordinate system respectively, and determining a normal vector of the boundary line according to the multiple target points after coordinate conversion;
step 103: and determining the display pose of the load graphic element according to the normal vector of the edge line so as to display the load graphic element.
In this embodiment, a plurality of target points may be determined from the inside of the mesh surface and the edge line of the mesh surface, and the target points may represent coordinate information of the inside of the mesh surface and the key positions on the edge line of the mesh surface.
The target coordinate system is mainly used for converting three-dimensional coordinates of a plurality of target points, and one coordinate value in the three-dimensional coordinates of the plurality of target points after conversion is 0, so that a normal vector of a boundary line can be obtained under a two-dimensional scene, and the solving process is simplified.
The display pose of the load graphic primitive mainly comprises a display position and a display direction of the load graphic primitive, and the display pose of the load graphic primitive can be determined according to the normal vector of the side line because a certain association relation exists between the display pose of the load graphic primitive and the starting point position and the vector direction of the normal vector of the side line, so that the load graphic primitive is accurately presented to a user.
According to the method for displaying the load graphic element, in the process of determining the normal vector of the side line, the plurality of target points in the three-dimensional coordinate scene are converted into the two-dimensional coordinate scene, and the determination flow of the normal vector of the side line is simplified in a coordinate conversion mode, so that the determination process of the normal vector of the side line is more convenient and reliable, the determination efficiency and accuracy of the load graphic element are improved, and the load graphic element is displayed efficiently and reliably.
In some embodiments, determining a plurality of target points from inside the grid surface to which the load is to be applied and the edge may specifically include:
determining a geometric center point corresponding to the grid surface from the interior of the grid surface;
determining a target line segment from the side line, and determining a plurality of line segment key points of the target line segment;
the target line segment is used for representing the area where the load to be applied is located at the action position of the side line.
In this embodiment, the load is applied to the edge line of the grid surface of the simulation graph, where the edge line of the grid surface may be understood as a line segment set formed by a plurality of edge line segments, and the target line segment is one edge line segment in the line segment set, which can represent the area where the load to be applied is located at the action position of the edge line, that is, the specific action position of the load to be applied may be further determined according to the target line segment.
The geometric center point and the plurality of line segment key points which are finally obtained are used as a plurality of target points, the line segment key points can be coordinate points corresponding to a plurality of key positions on the target line segment, and the key positions can be the center position and the two end positions of the target line segment in the embodiment.
In some embodiments, the edge line may include a plurality of edge line segments, and determining the target line segment from the edge line may include:
determining a communication ring which contains partial edge line segments and has the largest number of edge line segments from the grid surface to obtain a target communication ring;
extracting edge line segments contained in the target communication ring from the edge line to construct an edge line segment set;
a target line segment is determined from the set of edge line segments.
In this embodiment, the edge line of the mesh surface may be formed by sequentially connecting a plurality of edge line segments, and in this embodiment, the target line segment is accurately determined from the plurality of edge line segments by determining the communication ring. The communication ring can be a closed structure formed by encircling a plurality of edge line segments with partial line segments inside the grid surface.
In this embodiment, the mesh surface may be a geometric plane with multiple meshes divided into any shape, fig. 2 illustrates an elliptical mesh surface, where the mesh surface may be divided into multiple connected rings including edge segments, fig. 2 illustrates three groups of edge segments determined by the connected rings, which are respectively edge segment combination 201, edge segment combination 202 and edge segment combination 203 illustrated in fig. 2, where edge segment combination 201 includes 7 edge segments, edge segment combination 202 includes 5 edge segments, and edge segment combination 203 includes 3 edge segments, accordingly, the number of edge segments included in edge segment combination 201 is the largest, that is, the set of edge segments determined by the target connected ring. Thereafter, an edge line segment may be extracted from the set of edge line segments as a target line segment.
In an exemplary embodiment, determining the target line segment from the edge line segment set may specifically include:
and extracting an edge line segment positioned at or close to the middle position from the edge line segment set to obtain a target line segment.
In this embodiment, the target line segment may be an edge line segment located at or near the middle position in the edge line segment set, and it is understood that each edge line segment in the edge line segment set is sequentially connected, so that an edge line segment located at or near the middle position may be used as the target line segment. Referring to fig. 3, still taking an elliptical mesh plane as an example, since the set of edge line segments determined in the mesh plane is formed by sequentially connecting 7 edge line segments, the fourth edge line segment 301 is an edge line segment located at a middle position, that is, a target line segment, when counted from any side.
In the actual application process, if the edge line segment set determined according to the target grid surface contains odd number of edge line segments, the target line segment is the edge line segment positioned at the middle position in the edge line segment set; if the edge line segment set determined according to the target mesh surface contains even number of edge line segments, the target line segment is an edge line segment near the middle position in the edge line segment set, for example, if the edge line segment set contains 6 edge line segments, the target line segment can be the 3 rd edge line segments from one side.
In some embodiments, establishing the target coordinate system according to the plurality of target points may specifically include:
determining a target plane according to at least three target points in a plurality of target points, and determining a normal vector of the target plane, wherein the at least three target points comprise at least one point positioned inside a grid surface and at least two points positioned on a side line;
and establishing a target coordinate system according to the normal vectors of the target planes and the target points.
In this embodiment, a plane is determined by using three points, and the target plane is determined according to at least three target points of the plurality of target points, and it can be understood that at least two non-collinear coordinate points exist in the at least three target points.
For example, the at least three target points may be geometric center points of the mesh surface and at least two line segment key points corresponding to the target line segments located on the edge line, and a target plane may be determined according to the geometric center points and the line segment key points.
In a specific embodiment, the line segment key points may include two line segment end points of the target line segment, and specifically, the target plane may be determined according to the geometric center point and the two line segment end points, that is, the three points determine a plane. Fig. 4 shows a target plane 401 determined from a geometric center point c and two line segment end points a and b, and a normal vector n to the target plane 401. And then, according to the key points of the line segments and the normal vector of the target plane, determining coordinate axes of three dimensions, and establishing a target coordinate system.
It will be appreciated that the normal vector to the target plane may be determined by:
firstly, two non-collinear known vectors, namely a first known vector and a second known vector, are determined in a target plane, wherein the first known vector in the embodiment can be a vector corresponding to a geometric center point to a line segment endpoint a, and the second known vector can be a vector corresponding to a geometric center point to a line segment endpoint b;
and then, respectively carrying out quantity product zero on the normal vector of the target plane to be solved and the first known vector and the second known vector, and establishing a solving equation set to obtain the normal vector of the target plane.
In the practical application process, the geometric center point of the grid surface can be obtained through a bounding box algorithm, the bounding box algorithm is a method for solving the optimal bounding space of a discrete point set, the basic idea is to approximately replace a complex geometric object with a geometric body (called a bounding box) with a slightly larger volume and simple characteristics, and the process of determining the geometric center point of the grid surface through the bounding box algorithm is specifically as follows:
firstly, determining a bounding box corresponding to a grid surface, wherein the bounding box contains all key vertexes of the grid surface;
and then, respectively calculating the maximum value and the minimum value of the three-dimensional coordinates of each point on the bounding box, and determining the three-dimensional coordinates of the central point of the bounding box based on the average value of the maximum value and the minimum value of the three-dimensional coordinates, so as to obtain the geometric central point.
In an exemplary embodiment, the plurality of target points includes a plurality of line segment keypoints corresponding to target line segments located on the edge, and the plurality of line segment keypoints may include line segment endpoints and line segment midpoints;
establishing a target coordinate system according to the normal vectors of the target planes and the target points, which specifically comprises the following steps:
taking the midpoint of the line segment as an origin, taking a vector determined from the origin to any line segment endpoint as an x-axis, taking a normal vector of a target plane as a z-axis, and determining a y-axis according to a cross product of the x-axis and the z-axis;
and establishing a target coordinate system according to the x-axis, the y-axis and the z-axis.
In this embodiment, the target coordinate system may be a three-dimensional coordinate system determined by taking a normal vector of the target plane as a z-axis, and fig. 5 shows the target coordinate system, where the x-axis is determined by a vector m corresponding to a line segment midpoint p to a line segment endpoint a, the z-axis is determined by a normal vector n of the target plane, that is, the z-axis passes through the origin and is the same as the normal vector n of the target plane, and the y-axis may be determined according to a cross product of the x-axis and the z-axis.
Cross products, also known as vector products, are binary operations of vectors in vector space, which can be expressed as mxn, oriented perpendicular to the plane of the two vectors, m and n.
After the target coordinate system is established, the multiple target points may be respectively converted into the target coordinate system, in this embodiment, the multiple target points specifically include a geometric center point of the grid surface and the line segment key points, and specifically, coordinates of the geometric center point and the line segment key points including a line segment midpoint and a line segment endpoint in the global coordinate system may be respectively converted into the target coordinate system.
Specifically, according to the relation between the corresponding coordinate origin under the global coordinate system and the corresponding coordinate origin under the target coordinate system, the change rule of each coordinate value in the process of converting the global coordinate system into the target coordinate system is determined, so that the coordinate values of the line segment key point and the geometric center point under the global coordinate system can be converted into the target coordinate system according to the change rule of each coordinate.
For example, the coordinate origin of the target coordinate system, i.e., the coordinates of the point p of the line segment in the global coordinate system are (e, f, g), and the coordinates of the point p of the line segment in the target coordinate system are (0, 0), that is, the origin of the target coordinate system is shifted by a distance e in the x-axis direction, a distance f in the y-axis direction, and a distance g in the z-axis direction with respect to the global coordinate system.
In this case, when the line segment end points and the geometric center point are converted from the global coordinate system to the target coordinate system, it is also necessary to translate the points by a distance e in the x-axis direction, a distance f in the y-axis direction, and a distance g in the z-axis direction, so as to obtain the coordinate values of the points in the target coordinate system.
It should be noted that, because the z-axis of the target coordinate system is determined according to the normal vector of the target plane, the plurality of target points including the line segment key points and the geometric center points are all located on the target plane, so that after the plurality of target points including the line segment key points and the geometric center points are converted into the target coordinate system, the z-axis coordinate values of the plurality of target points are all 0, thereby converting the three-dimensional vector solving problem into the two-dimensional vector solving problem, reducing the dimension can reduce the calculated vector to a certain extent, simplifying the calculation flow of the normal vector of the edge, and improving the solving efficiency of the normal vector of the edge.
In some embodiments, determining the normal vector of the edge according to the plurality of target points after coordinate transformation may specifically include:
according to at least three target points in the plurality of target points after coordinate conversion, respectively determining a first vector and a second vector, wherein the at least three target points comprise at least one point positioned in the grid surface and at least two points positioned on the side line;
a normal vector of the edge is determined from the first vector and the second vector.
In this embodiment, the first vector and the second vector are determined by at least three target points, where the first vector and the second vector may be two non-parallel vectors with the same start point and different end points, and the normal vector of the edge line may be further determined by the first vector and the second vector.
In an exemplary embodiment, the at least three target points include a geometric center point of the mesh surface, and a plurality of line segment key points corresponding to target line segments located on the edge, the plurality of line segment key points including line segment end points and line segment midpoints;
according to at least three target points in the plurality of target points after coordinate conversion, respectively determining a first vector and a second vector, including:
determining a first vector according to the midpoint of the line segment and any one of the line segment end points after coordinate conversion;
and determining a second vector according to the geometric center point and the line segment midpoint after coordinate conversion.
In this embodiment, the first vector is determined by the midpoint of the line segment and one of the line segment end points, referring to fig. 6, a vector m corresponding to the midpoint p of the line segment to the line segment end point a in the target coordinate system may be used as a first vector, and a vector u corresponding to the midpoint p of the line segment to the geometric center point c in the target coordinate system may be used as a second vector.
In an exemplary embodiment, determining the normal vector of the edge from the first vector and the second vector may specifically include: rotating the first vector forward or backward by a specific angle to obtain a third vector;
and determining an included angle between the third vector and the second vector, and determining a normal vector of the side line according to the corresponding third vector when the included angle is larger than a preset angle threshold.
In this embodiment, when determining the normal vector of the edge, the first vector is rotated to obtain the third vector, and in this embodiment, the first vector may be rotated forward or backward by 90 degrees to obtain the third vector, see fig. 6, and the first vector m is rotated by 90 degrees to obtain the third vector m 1 The first vector m is rotated by-90 degrees to obtain a third vector m 2
After the third vector is obtained, the angle between the third vector and the second vector is determined, and FIG. 6 shows a third vector m 1 Included angle r with second vector u 1 And a third vector m 2 Included angle r with second vector u 2
After determining the included angle between the third vector and the second vector, carrying out the obtained included angle and a preset included angle threshold valueComparing, determining a corresponding third vector when the included angle is greater than a preset angle threshold, where the preset angle threshold may take 90 degrees in this embodiment. Referring to FIG. 6, a third vector m 1 Included angle r with second vector u 1 Greater than 90 degrees and a third vector m 2 Included angle r with second vector u 2 Significantly less than 90 degrees, so the third vector m 1 I.e. the third vector ultimately required.
After determining the corresponding third vector when the included angle is greater than the preset angle threshold, namely the third vector m in fig. 6 1 The third vector m 1 The normal vector of the boundary line can be obtained by converting the target coordinate system into the global coordinate system.
After the normal vector of the edge is determined, the display pose of the load primitive can be determined according to the normal vector of the edge, so that the load primitive can be accurately displayed.
In this embodiment, the display pose of the load primitive may be a display position and a display direction of the load primitive, where a certain correspondence exists between the display pose of the load primitive and a start position and a vector direction of a normal vector of a boundary, and the display pose of the load primitive may be directly determined according to the correspondence.
For example, when the load to be applied is a pressure load, the display position of the load primitive corresponding to the pressure load is the start position of the normal vector of the edge, the display direction of the load primitive corresponding to the pressure load is opposite to the vector direction of the normal vector of the edge, and fig. 7 shows the display state of the load primitive corresponding to the pressure load.
In the practical application process, the load to be applied can also be a current load, in the simulation process of the two-dimensional electromagnetic model, the load graphic element corresponding to the current load is the current graphic element, the display position of the current graphic element is the same as the starting point position of the normal vector of the side line of the two-dimensional electromagnetic model, the display direction of the current graphic element is related to the positive and negative directions of the current, for example, the positive direction of the current is the same as the vector direction of the normal vector of the side line, or the opposite direction of the current is the same as the vector direction of the normal vector of the side line.
In summary, according to the method for displaying the load primitive disclosed in the embodiment, the solving scene is transformed from three dimensions to two dimensions in a coordinate transformation manner, so that the normal vector of the boundary line of the grid surface to which the load is to be applied is rapidly and accurately determined in the two-dimensional scene, and the display pose of the load primitive is further determined according to the normal vector of the boundary line, thereby realizing efficient and accurate display of the load primitive.
Corresponding to the embodiment of the application function implementation method, the application also provides a display device of the load graphic element, electronic equipment and corresponding embodiments.
Fig. 8 is a schematic structural diagram of a display device of a load primitive shown in an embodiment of the present application.
Referring to fig. 8, a display device for a load primitive provided in an embodiment of the present application specifically includes:
a first processing module 801, configured to determine a plurality of target points from inside a grid surface to which a load is to be applied and a boundary, and establish a target coordinate system according to the plurality of target points, where one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points; a second processing module 802, configured to convert the plurality of target points into a target coordinate system, and determine a normal vector of the boundary line according to the plurality of target points after coordinate conversion;
and a third processing module 803, configured to determine a display pose of the load primitive according to a normal vector of the edge line, so as to display the load primitive.
In some embodiments, in the first processing module 801, determining a plurality of target points from the interior of the grid surface to which the load is to be applied and the edge line specifically includes:
determining a geometric center point corresponding to the grid surface from the interior of the grid surface;
determining a target line segment from the side line, and determining a plurality of line segment key points of the target line segment; the target line segment is used for representing the area where the load to be applied is located at the action position of the side line.
In an exemplary embodiment, the edge line includes a plurality of edge line segments, and in the first processing module 801, determining the target line segment from the edge line specifically includes:
determining a communication ring which contains partial edge line segments and has the largest number of edge line segments from the grid surface to obtain a target communication ring;
extracting edge line segments contained in the target communication ring from the edge line to construct an edge line segment set;
a target line segment is determined from the set of edge line segments.
In an exemplary embodiment, the first processing module 801 determines a target line segment from the edge line segment set, specifically includes:
and extracting an edge line segment positioned at or close to the middle position from the edge line segment set to obtain a target line segment.
In some embodiments, in the first processing module 801, a target coordinate system is established according to a plurality of target points, which specifically includes:
determining a target plane according to at least three target points in a plurality of target points, and determining a normal vector of the target plane, wherein the at least three target points comprise at least one point positioned inside a grid surface and at least two points positioned on a side line;
and establishing a target coordinate system according to the normal vectors of the target planes and the target points.
In an exemplary embodiment, the plurality of target points includes a plurality of line segment keypoints corresponding to target line segments located on the edge, the plurality of line segment keypoints including line segment end points and line segment midpoints;
in the first processing module 801, a target coordinate system is established according to a plurality of target points and normal vectors of a target plane, and specifically includes: taking the midpoint of the line segment as an origin, taking a vector determined from the origin to any line segment endpoint as an x-axis, taking a normal vector of a target plane as a z-axis, and determining a y-axis according to a cross product of the x-axis and the z-axis;
and establishing a target coordinate system according to the x-axis, the y-axis and the z-axis.
In some embodiments, in the second processing module 802, determining the normal vector of the edge according to the plurality of target points after the coordinate transformation includes:
according to at least three target points in the plurality of target points after coordinate conversion, respectively determining a first vector and a second vector, wherein the at least three target points comprise at least one point positioned in the grid surface and at least two points positioned on the side line;
a normal vector of the edge is determined from the first vector and the second vector.
In an exemplary embodiment, the at least three target points include a geometric center point of the mesh surface, and a plurality of line segment key points corresponding to target line segments located on the edge, the plurality of line segment key points including line segment end points and line segment midpoints;
in the second processing module 802, a first vector and a second vector are respectively determined according to at least three target points in the plurality of target points after coordinate transformation, and specifically include:
determining a first vector according to the midpoint of the line segment and any one of the line segment end points after coordinate conversion;
and determining a second vector according to the geometric center point and the line segment midpoint after coordinate conversion.
In the exemplary embodiment, in second processing module 802, determining a normal vector to the edge from the first vector and the second vector includes:
rotating the first vector forward or backward by a specific angle to obtain a third vector;
and determining an included angle between the third vector and the second vector, and determining a normal vector of the side line according to the corresponding third vector when the included angle is larger than a preset angle threshold.
In summary, in the display device for load primitives provided in the embodiment of the present application, one coordinate axis of the target coordinate system is determined by a normal vector common to multiple target points, after coordinate conversion is performed on the multiple target points, the coordinate value of one dimension is zero, so that the normal vector of the boundary line can be conveniently determined in a two-dimensional scene, and further the load primitives can be accurately displayed, and the efficiency and reliability of the load primitive determination process are improved.
Fig. 9 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
Referring to fig. 9, an electronic device 900 includes a memory 901 and a processor 902.
The processor 902 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 901 may include various types of storage units, such as system memory, read Only Memory (ROM), and persistent storage. Where the ROM may store static data or instructions that are required by the processor 902 or other modules of the computer. The persistent storage may be a readable and writable storage. The persistent storage may be a non-volatile memory device that does not lose stored instructions and data even after the computer is powered down. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the persistent storage may be a removable storage device (e.g., diskette, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as dynamic random access memory. The system memory may store instructions and data that are required by some or all of the processors at runtime.
Furthermore, memory 901 may include any combination of computer readable storage media including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read only memory), magnetic disks, and/or optical disks may also be employed. In some implementations, memory 901 may include a readable and/or writable removable storage device such as a Compact Disc (CD), a digital versatile disc read only (e.g., DVD-ROM, dual layer DVD-ROM), a blu-ray read only disc, an super-dense disc, a flash memory card (e.g., SD card, min SD card, micro-SD card, etc.), a magnetic floppy disk, and the like. The computer readable storage medium does not contain a carrier wave or an instantaneous electronic signal transmitted by wireless or wired transmission.
The memory 901 has stored thereon executable code that, when processed by the processor 902, may cause the processor 902 to perform some or all of the methods described above.
Furthermore, the method according to the present application may also be implemented as a computer program or computer program product comprising computer program code instructions for performing part or all of the steps of the above-described method of the present application.
Alternatively, the present application may also be embodied as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) having stored thereon executable code (or a computer program or computer instruction code) which, when executed by a processor of an electronic device (or a server, etc.), causes the processor to perform part or all of the steps of the above-described methods according to the present application.
The embodiments of the present application have been described above, the foregoing description is exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (12)

1. A method for displaying a load primitive, comprising:
determining a plurality of target points from the inside of a grid surface to which a load is to be applied and a boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points;
converting the target points into the target coordinate system respectively, and determining normal vectors of the boundary according to the target points after coordinate conversion;
and determining the display pose of the load graphic element according to the normal vector of the side line so as to display the load graphic element.
2. The method of displaying a load primitive according to claim 1, wherein determining a plurality of target points from inside a mesh plane to which a load is to be applied and from edges comprises:
determining a geometric center point corresponding to the grid surface from the inside of the grid surface;
determining a target line segment from the side line, and determining a plurality of line segment key points of the target line segment; the target line segment is used for representing the area where the load to be applied is located at the action position of the side line.
3. The method of displaying a load primitive according to claim 2, wherein the edge line comprises a plurality of edge line segments, and wherein determining a target line segment from the edge line comprises:
determining a communication ring which contains partial edge line segments and has the largest number of edge line segments from the grid surface to obtain a target communication ring;
extracting edge line segments contained in the target communication ring from the edge line to construct an edge line segment set;
the target line segment is determined from the set of edge line segments.
4. A method of displaying a load primitive according to claim 3, wherein said determining the target line segment from the set of edge line segments comprises:
and extracting an edge line segment positioned at or close to the middle position from the edge line segment set to obtain a target line segment.
5. The method for displaying a load primitive according to claim 1, wherein said establishing a target coordinate system according to said plurality of target points comprises:
determining a target plane according to at least three target points in the plurality of target points, and determining a normal vector of the target plane, wherein the at least three target points comprise at least one point positioned inside the grid surface and at least two points positioned on the side line; and establishing a target coordinate system according to the target points and the normal vector of the target plane.
6. The method of claim 5, wherein the plurality of target points include a plurality of line segment keypoints corresponding to target line segments located on the edge, the plurality of line segment keypoints including a line segment endpoint and a line segment midpoint; the establishing a target coordinate system according to the target points and the normal vector of the target plane comprises the following steps:
taking the midpoint of the line segment as an origin, taking a vector determined from the origin to any line segment endpoint as an x-axis, taking a normal vector of the target plane as a z-axis, and determining a y-axis according to a cross product of the x-axis and the z-axis;
and establishing the target coordinate system according to the x-axis, the y-axis and the z-axis.
7. The method for displaying a load primitive according to claim 1, wherein determining a normal vector of the edge according to the plurality of target points after coordinate transformation comprises:
according to at least three target points in the plurality of target points after coordinate conversion, respectively determining a first vector and a second vector, wherein the at least three target points comprise at least one point positioned in the grid surface and at least two points positioned on the side line; and determining the normal vector of the side line according to the first vector and the second vector.
8. The method of claim 7, wherein the at least three target points include geometric center points of the mesh surface and a plurality of line segment key points corresponding to target line segments located on the edge, the plurality of line segment key points including line segment end points and line segment middle points;
the determining the first vector and the second vector according to at least three target points in the plurality of target points after coordinate conversion includes:
determining a first vector according to the midpoint of the line segment and any line segment end point after coordinate conversion;
and determining a second vector according to the geometric center point and the line segment midpoint after coordinate conversion.
9. The method of claim 7, wherein determining the normal vector of the edge from the first vector and the second vector comprises:
rotating the first vector forward or backward by a specific angle to obtain a third vector;
and determining an included angle between the third vector and the second vector, and determining a normal vector of the side line according to the corresponding third vector when the included angle is larger than a preset angle threshold.
10. A display device for a load primitive, comprising:
the first processing module is used for determining a plurality of target points from the inside of a grid surface to which a load is to be applied and the boundary line, and establishing a target coordinate system according to the plurality of target points, wherein one coordinate axis of the target coordinate system is determined by a normal vector common to the plurality of target points;
the second processing module is used for respectively converting the plurality of target points into the target coordinate system and determining the normal vector of the boundary line according to the plurality of target points after coordinate conversion;
and the third processing module is used for determining the display pose of the load graphic primitive according to the normal vector of the edge line so as to display the load graphic primitive.
11. An electronic device, comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-9.
12. A computer readable storage medium having stored thereon executable code which when executed by a processor of an electronic device causes the processor to perform the method of any of claims 1-9.
CN202310010569.5A 2023-01-05 2023-01-05 Load graphic element display method and device, electronic equipment and storage medium Active CN115688497B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310010569.5A CN115688497B (en) 2023-01-05 2023-01-05 Load graphic element display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310010569.5A CN115688497B (en) 2023-01-05 2023-01-05 Load graphic element display method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115688497A CN115688497A (en) 2023-02-03
CN115688497B true CN115688497B (en) 2023-05-05

Family

ID=85057069

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310010569.5A Active CN115688497B (en) 2023-01-05 2023-01-05 Load graphic element display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115688497B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831275A (en) * 2012-08-31 2012-12-19 中国科学技术大学 Method and system for simulating 3D fluid
CN104077428A (en) * 2014-02-26 2014-10-01 浙江工业大学 Remote finite element analysis method serving for industry alliance
CN111709097A (en) * 2020-06-08 2020-09-25 西安交通大学 Zero-deficiency mesh curved surface continuous deformation-based compliant mechanism generation method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2884454A1 (en) * 2013-12-16 2015-06-17 Thomson Licensing Method for watermarking a three-dimensional object
US11256729B2 (en) * 2018-03-29 2022-02-22 Aurora Operations, Inc. Autonomous vehicle relative atlas incorporating hypergraph data structure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831275A (en) * 2012-08-31 2012-12-19 中国科学技术大学 Method and system for simulating 3D fluid
CN104077428A (en) * 2014-02-26 2014-10-01 浙江工业大学 Remote finite element analysis method serving for industry alliance
CN111709097A (en) * 2020-06-08 2020-09-25 西安交通大学 Zero-deficiency mesh curved surface continuous deformation-based compliant mechanism generation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘玉琳 ; 戚俊清 ; .基于ANSYS的轴对称旋转构件优化设计方法.煤矿机械.(第04期),22-24. *

Also Published As

Publication number Publication date
CN115688497A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US10706622B2 (en) Point cloud meshing method, apparatus, device and computer storage media
Chang et al. Algorithm and architecture of disparity estimation with mini-census adaptive support weight
US8860723B2 (en) Bounded simplification of geometrical computer data
CN102214369B (en) Hierarchical bounding of displaced parametric surfaces
TWI479451B (en) Edge processing techniques
US8345064B2 (en) Method and system for tile binning using half-plane edge function
US8471852B1 (en) Method and system for tessellation of subdivision surfaces
CN111724313B (en) Shadow map generation method and device
CN104200425A (en) Device and method for entity clipping during graphic processing unit (GPU) graphic processing
JP2017062789A (en) Graphics processing apparatus and method for determining lod for texturing
US20130169636A1 (en) Accelerated Compute Tessellation by Compact Topological Data Structure
Gupta et al. A correlation-based approach for real-time stereo matching
CN115688497B (en) Load graphic element display method and device, electronic equipment and storage medium
US8264487B2 (en) Method for converting polygonal surfaces to levelsets
US8200041B2 (en) Hardware accelerated silhouette detection
Liang et al. Complex 3d shape recovery using a dual-space approach
GB2605360A (en) Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City
Tseng et al. 3D surface simplification based on extended shape operator
US9449424B2 (en) Visualization of field of view obstruction by an ellipsoid
CN113847921A (en) Method for establishing map object three-dimensional model and electronic equipment
CN118013770B (en) Discrete grid patch geometric topological relation reconstruction method, device, equipment and storage medium
CN112164131B (en) Method, device and computer equipment for cutting section of internal structure based on Unity engine
Falcao et al. Comparative analysis of shell rendering and shear-warp rendering
Kong et al. Collosion detection research based on capsule bounding
Huang et al. Adaptive support weight aggregation in segmentationsfor stereo matching

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