CN114742877A - Method and device for determining spatial polygon area, electronic equipment and storage medium - Google Patents

Method and device for determining spatial polygon area, electronic equipment and storage medium Download PDF

Info

Publication number
CN114742877A
CN114742877A CN202210330805.7A CN202210330805A CN114742877A CN 114742877 A CN114742877 A CN 114742877A CN 202210330805 A CN202210330805 A CN 202210330805A CN 114742877 A CN114742877 A CN 114742877A
Authority
CN
China
Prior art keywords
polygon
area
determining
line segment
boundary 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.)
Pending
Application number
CN202210330805.7A
Other languages
Chinese (zh)
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.)
Softcom Power Information Technology Group Co ltd
Original Assignee
Softcom Power Information Technology Group Co 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 Softcom Power Information Technology Group Co ltd filed Critical Softcom Power Information Technology Group Co ltd
Priority to CN202210330805.7A priority Critical patent/CN114742877A/en
Publication of CN114742877A publication Critical patent/CN114742877A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the application discloses a method and a device for determining the area of a spatial polygon, electronic equipment and a storage medium. The method comprises the following steps: acquiring target boundary points of a space plane polygon, and determining at least one boundary line segment; acquiring a plane normal vector of a spatial plane polygon; and determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon. The embodiment of the application realizes the improvement of the calculation efficiency of the space polygon area.

Description

Method and device for determining spatial polygon area, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to a spatial geometry calculation technology, in particular to a method and a device for determining the area of a spatial polygon, an electronic device and a storage medium.
Background
The calculation of the polygon area is a complicated problem, and usually, the polygon is divided into triangles, and then the areas of the triangles are accumulated, so that the calculation process is more complicated with the increase of vertexes.
Conventional CAD (Computer Aided Design) software solves the area of a planar polygon based on the heleny formula.
However, the traditional algorithm can only be applied to the field of two-dimensional plane design, but cannot be applied to the field of three-dimensional space.
Disclosure of Invention
The application provides a method and a device for determining the area of a spatial polygon, electronic equipment and a storage medium, so as to improve the calculation efficiency of the area of the spatial polygon.
In a first aspect, an embodiment of the present application provides a method for determining a spatial polygon area, where the method includes:
acquiring target boundary points of a space plane polygon, and determining at least one boundary line segment;
acquiring a plane normal vector of a spatial plane polygon;
and determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
In a second aspect, an embodiment of the present application further provides a spatial polygon area determining apparatus, including:
the boundary line segment determining module is used for acquiring target boundary points of the space plane polygon and determining at least one boundary line segment;
the plane normal vector acquisition module is used for acquiring a plane normal vector of the space plane polygon;
and the space polygon area determining module is used for determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the spatial polygon area determination methods provided by the embodiments of the present application.
In a fourth aspect, the present application further provides a storage medium including computer-executable instructions, which when executed by a computer processor, are configured to perform any one of the spatial polygon area determination methods provided by the embodiments of the present application.
The method comprises the steps of determining at least one boundary line segment by obtaining a target boundary point of a space polygon, obtaining a plane normal vector of the space plane polygon according to the boundary line segment, determining unit areas corresponding to the boundary line segments according to the boundary line segments and the normal vector, accumulating the unit areas corresponding to the boundary line segments to obtain the area of the space polygon, and directly calculating the area of the space polygon through obtaining the target boundary point of the space polygon. Therefore, the technical scheme of the application solves the problem that the traditional algorithm can only be applied to the field of two-dimensional plane design but cannot be applied to the field of three-dimensional space, realizes the direct calculation of the space polygon area, improves the efficiency of calculating the space polygon area and improves the universality of the method for calculating the space polygon area.
Drawings
Fig. 1 is a flowchart of a method for determining a spatial polygon area according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of a plane normal vector of a spatial plane polygon according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for determining a spatial polygon area according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of a spatial polygon area determining apparatus in a third embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in a fourth embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first" and "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a method for determining a spatial polygon area according to an embodiment of the present disclosure, where the embodiment is applicable to a case of calculating a spatial polygon area, and the method may be executed by a spatial polygon area determining apparatus, which may be implemented by software and/or hardware and is specifically configured in an electronic device.
Referring to the method for determining the area of the spatial polygon shown in fig. 1, the method specifically includes the following steps:
s110, acquiring target boundary points of the space plane polygon, and determining at least one boundary line segment.
The spatial planar polygon is a polygon in space. A point on a planar polygon may be represented by planar coordinates, i.e. the coordinates contain two parameters (x, y), and a point on a spatial planar polygon needs to be represented by spatial coordinates, i.e. the coordinates contain three parameters (x, y, z). The target boundary points are points on the boundary of the spatial plane polygon, which can be understood as vertices of the spatial plane polygon, and are used for determining the boundary line segments. The boundary line segment is a line segment formed by connecting two adjacent target boundary points of the space polygon. It is understood that the spatial polygon area is the area of a polygon formed by connecting boundary line segments end to end in sequence. Specifically, when the space plane polygon is a triangle, the space plane polygon has 3 target boundary points, and may determine 3 boundary line segments, and when the target boundary points of the space plane polygon increase, the determined boundary line segments also increase correspondingly.
In an optional embodiment, after obtaining the target boundary points of the spatial plane polygon, the method further includes: and under the condition that the number of the target boundary points of the space plane polygon is less than three, performing calculation alarm.
The polygon is a closed figure formed by sequentially connecting three or more line segments which are not on the same straight line end to end and not intersecting. It is understood that a triangle is the simplest polygon, and in the case where the number of target boundary points is less than three, a polygon cannot be formed, and thus the area of the polygon cannot be calculated. The calculation warning is used for warning the user when the area of the polygon cannot be calculated, and illustratively, a window can be popped up to prompt that "the number of boundary points is insufficient and effective calculation cannot be performed".
And under the condition that the number of the target boundary points of the space plane polygon is less than three, performing calculation alarm to prompt a user to check whether the input of the space polygon for solving the area is correct or not in time and correct errors in time.
And S120, acquiring a plane normal vector of the space plane polygon.
The plane normal vector is a vector perpendicular to the spatial plane, and specifically, the plane normal vector can be obtained by cross-product calculation of a boundary line segment of the spatial plane. Specifically, two non-parallel boundary line segments (e.g., having the same boundary point) are cross-multiplied to obtain a normal vector of a polygon of a space plane where the two boundary line segments are located. Fig. 2 is a schematic diagram of a plane normal vector of a spatial plane polygon provided in the present application. As shown in FIG. 2, the target boundary points O, A and B may determine boundary line segmentsOA and OB, i.e. in the figure
Figure BDA0003573016300000051
Figure BDA0003573016300000052
And
Figure BDA0003573016300000053
Figure BDA0003573016300000054
is a normal vector determined by cross multiplication.
And S130, determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
The cell area is the area of the polygon corresponding to the boundary line segment. For example, the target boundary points in the obtained space plane polygon may be numbered in order (clockwise or counterclockwise), and three target boundary points adjacent in order are taken as a group, a first target boundary point and a second target boundary point are connected to form a first boundary line segment, the first target boundary point and a third target boundary point are connected to form an auxiliary line segment of the first boundary line segment, a normal vector is determined according to the first boundary line segment and the auxiliary line segment thereof, and a unit area corresponding to the first boundary line segment is determined according to the first boundary line segment and the normal vector thereof. And sequentially determining the unit areas corresponding to other boundary line segments, and performing accumulation calculation on the unit areas corresponding to the boundary line segments to obtain the area of the space polygon.
In an alternative embodiment, the spatial planar polygon comprises a three-dimensional geometrically closed area.
The three-dimensional geometric closed region refers to a closed three-dimensional figure, namely, target boundary points of a space plane polygon are sequentially connected end to form a closed figure. For example, the three-dimensional geometrically closed area may be a house surface, a wall, a floor, a finishing material, and the like. These real objects are usually polygonal, but are usually placed on a plane other than the ground due to construction or use, resulting in complicated area calculation.
The area is calculated as the area of the closed graph, the space plane polygon comprises a three-dimensional geometric closed area, and the area of the space plane polygon can be determined; and the conventional space volume can be calculated based on the space area, and the calculated value can be used in the data fields of illumination calculation, energy consumption calculation and the like.
In the prior art, the calculation process of the area of a polygon is relatively complicated, and the traditional method for solving the area of a planar polygon by CAD software generally comprises the steps of dividing the polygon into a plurality of triangles and then solving the algebraic sum of the areas of the triangles. The algorithm is mainly based on a Helen formula for data calculation, wherein the Helen formula is a formula for directly calculating the area of a triangle by using the side length of three sides of the triangle. However, the Helen formula cannot calculate the polygon area of the space, and can only be applied to the field of two-dimensional plane design, while in the field of three-dimensional space, the method theory cannot be applied. Therefore, many software cannot directly utilize the Helen formula when calculating the area of the spatial polygon, and the universality is poor. The method is high in universality, simple in algorithm and easy to use for programming implementation, and in application, the more the vertexes of the polygon are, the more the efficiency of the method for calculating the area is improved.
According to the technical scheme, at least one boundary line segment is determined by obtaining the target boundary point of the space polygon, the plane normal vector of the space plane polygon is obtained according to the boundary line segment, the unit area corresponding to each boundary line segment is determined according to each boundary line segment and the normal vector, the unit areas corresponding to each boundary line segment are accumulated to obtain the area of the space polygon, and the area of the space polygon can be directly calculated by obtaining the target boundary point of the space polygon. Therefore, the technical scheme of the application solves the problem that the traditional algorithm can only be applied to the field of two-dimensional plane design and cannot be applied to the field of three-dimensional space, realizes the direct calculation of the space polygon area, improves the efficiency of calculating the space polygon area, and improves the universality of the method for calculating the space polygon area.
Example two
Fig. 3 is a flowchart of a flowchart method of a method for determining a spatial polygon area according to a second embodiment of the present application, and the technical solution of the present embodiment is further refined based on the above technical solution.
Further, the unit area corresponding to each boundary line segment is determined according to each boundary line segment and the normal vector, and the method is refined as follows: the unit area corresponding to the boundary line segment is determined according to the boundary line segment and the normal vector based on the Stokes formula, so that the calculation of the space polygon area is realized.
Referring to fig. 3, a method for determining a spatial polygon area includes:
s210, acquiring a target boundary point of the space plane polygon, and determining at least one boundary line segment.
In an alternative embodiment, determining at least one boundary line segment comprises: sequentially arranging the target boundary points according to the spatial positions of the target boundary points on the spatial plane polygon, wherein the arrangement sequence of the target boundary points adjacent to the spatial positions is adjacent; in the arrangement sequence, determining any two continuous target boundary points as a boundary line segment; in the arrangement order, the first target boundary point and the last target boundary point are determined as a boundary line segment.
The boundary points of the objects adjacent to each other in the spatial position may be the boundary points of the objects closest to each other in the spatial position, or may be two points closest to each other in one coordinate axis in the spatial position. And sequentially arranging the target boundary points according to the spatial positions of the boundary points. Illustratively, the target boundary points may be represented by Pi, where i is an integer from 1 to K, for representing the arrangement order of the target boundary points. For example, the target boundary point closest to the origin may be used as a first target boundary point in the arrangement order, and the target boundary points adjacent to the spatial position may be arranged in a clockwise or counterclockwise direction, or the first target boundary point may be randomly selected. And connecting two adjacent target boundary points in the arrangement sequence to form a boundary line segment, and sequentially connecting all the adjacent target boundary points according to the arrangement sequence to obtain the corresponding boundary line segment. In the arrangement sequence, the last target boundary point is the last target boundary point according to the arrangement direction. Because the boundary line segments determined by the first target boundary point and the last target boundary point are not included and are sequentially connected according to the arrangement sequence, the unit area corresponding to the boundary line segment is lost in the subsequent area solving process, so that a calculation result has a large error, and therefore the first target boundary point and the last target boundary point are determined as one boundary line segment in the arrangement sequence. Meanwhile, if the boundary line segments determined by the first target boundary point and the last target boundary point are not included, each boundary line segment cannot form a closed region, and the area solution is directed at the closed region, so that the area solution does not meet the requirement of solution.
The boundary line segments can be determined according to the spatial position sequence, so that the boundary line segments are prevented from being repeated or missing, and inaccurate calculation is realized. The first target boundary point and the last target boundary point are determined as a boundary line segment, the problem that the boundary line segments determined by the first target boundary point and the last target boundary point are omitted when two adjacent boundary points are connected according to the spatial position in sequence is solved, all boundary line segments on a spatial polygon closed curve can be obtained, and the accuracy of subsequent spatial polygon area calculation is improved.
S220, acquiring a plane normal vector of the space plane polygon.
In an alternative embodiment, obtaining a plane normal vector of a spatial plane polygon comprises: acquiring three target boundary points from each target boundary point; determining two direction vectors according to the three target boundary points; and determining a plane normal vector of the space plane polygon according to the two direction vectors.
Acquiring three target boundary points from each target boundary point, illustratively, acquiring three target boundary points which are adjacent in spatial sequence, and determining a direction vector according to the three target boundary points and a first target boundary point and a second target boundary point; and determining a direction vector according to the first target boundary point and the third target boundary point, and determining a plane normal vector of the space plane polygon according to cross multiplication of the two direction vectors. The second direction vector may also be determined for the second target boundary point and the third target boundary point. This is not limiting.
The three target boundary points are obtained from the target boundary points, two direction vectors are determined according to the three target boundary points, the plane normal vector of the space plane polygon is further determined, other coordinates do not need to be obtained additionally, the space polygon is divided into a plurality of triangles, and then the normal vector of the plane where the triangles are located is solved.
And S230, determining the area of the cell corresponding to the boundary line segment according to the boundary line segment and the normal vector based on the Stokes formula.
The stokes theorem refers to that when a vortex beam exists in a closed contour, the velocity circulation along the closed contour is equal to the sum of the vortex fluxes of all the vortex beams in the closed contour. Stokes' theorem indicates that the velocity momentum along a closed curve L is equal to the vortex flux through any curved surface that is bounded by the curve.
The ring is composed of continuous edges and has a sealing property. Illustratively, when the spatial polygon is a ring structure, the ring has an inner ring and an outer ring, and the solid portion of the ring is always on the left side when the ring is moved in the positive direction, and when viewed from the direction opposite to the normal vector of the surface to which the ring belongs, the outer ring is in the counterclockwise direction, and the inner ring is in the clockwise direction. The polygon vertexes are sequentially taken along the ring direction, the area is divided into positive and negative, the polygon area surrounded by the outer ring is positive, and the area surrounded by the inner ring is negative. Specifically, the symbol of the area can be determined by a formula by inputting the coordinate values of each vertex of the polygon in the direction sequence of the ring. And calculating the algebraic sum of the areas of the polygons enclosed by the rings, namely the area of the polygon with the annular structure.
P for target boundary point1,P2,P3,…,Pi,…,PKRepresents; cos (n, x) is a normal vector
Figure BDA0003573016300000091
The included angle with the coordinate axis X; cos (n, y) is a normal vector
Figure BDA0003573016300000092
The included angle with the coordinate axis Y; cos (n, z) is a normal vector
Figure BDA0003573016300000093
The included angle with the coordinate axis Z; line segment PiPi+1The parametric curve equation is as follows:
X=(1-t)Xi+tXi+1
Y=(1-t)Yi+tYi+1
Z=(1-t)Zi+tZi+1
wherein, the value range of t is [0, 1 ].
Line segment PiPi+1Parametric curve equation:
the space straight line is defined by the parameter equation of
Figure BDA0003573016300000101
From this it can be derived:
X=t(Xi+1-Xi)+Xi=(1-t)Xi+tXi+1
Y=t(Xi+1-Xi)+Xi=(1-t)Yi+tYi+1
Z=t(Xi+1-Xi)+Xi=(1-t)Zi+tZi+1
the derivative of the straight line is:
dx=(Xi+1-Xi)dt;
dy=(Yi+1-Yi)dt;
dz=(Zi+1-Zi)dt;
area SA of space polygon ═ integral-Ads; according to the Stokes formula
Figure BDA0003573016300000102
The following can be obtained:
let P ═ ycos (n, z), Q ═ zcos (n, x), R ═ xcos (n, y);
when P is-ycos gamma, then there are
Figure BDA0003573016300000103
Q ═ zcos alpha, then
Figure BDA0003573016300000111
R is-xcos beta, then
Figure BDA0003573016300000112
Thus, then:
Figure BDA0003573016300000113
where cos α, cos β and cos γ are directional cosines, i.e. all (3 in this application) cosine values of one vector direction. Specifically, cos α, cos β, and cos γ are cosines of an included angle between a vector where a boundary line segment is located and a base vector, and a sum of squares is 1, that is, a sum of squares of cosines of three direction angles of one vector is equal to 1, as shown in the following formula:
Figure BDA0003573016300000114
then the user can use the device to make a visual display,
Figure BDA0003573016300000115
wherein cos alpha2+cosβ2+cosγ2=1。
The right formula ═ piL(ycosγdx+zcosαdy+xcosβdz);
I.e. SA-PhiL(ycosγdx+zcosαdy+xcosβdz);
The space polygon is a closed figure, i.e. the first target edgeThe boundary points coincide with the boundary points of the tail target, and the P is recordedK+1=P1
Then the
Figure BDA0003573016300000116
Because of PK+1=P1,PKPK+1Is equivalent to PKP1Therefore, the calculation includes the unit area corresponding to the line segment between the last target boundary point and the first target boundary point, and the unit area does not need to be calculated independently.
And (3) substituting a linear parameter equation to obtain the following result through integral replacement:
Figure BDA0003573016300000121
using the integral parity variation, the following can be derived:
Figure BDA0003573016300000122
and (4) drawing a final conclusion formula:
Figure BDA0003573016300000123
by arranging the above formula, the following can be obtained:
Figure BDA0003573016300000124
based on the Stokes formula, the formula can be deduced, so that the area of the cell corresponding to the boundary line segment can be determined directly according to the boundary line segment and the normal vector, and the area of the cell is accumulated and calculated to obtain the area of the space plane polygon. And other parameters do not need to be calculated, the calculation is simple, and the calculation efficiency of the space polygon area is improved. The method can be suitable for various programming languages such as C + +, Python and C #, and can realize the rapid calculation of the space polygon area through software through programming.
And S240, accumulating to obtain the area of the space polygon.
According to the technical scheme of the embodiment, the area of the unit corresponding to the boundary line segment is determined by utilizing the boundary line segment and the normal vector based on the Stokes formula. The method comprises the steps of obtaining target boundary points of the space polygon only by obtaining boundary line segments through calculation, obtaining normal vectors according to the boundary line segments, obtaining unit areas according to the boundary line segments and the normal vectors through calculation, and adding the unit areas corresponding to the boundary line segments to obtain the area of the space polygon.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a spatial polygon area determining device according to a third embodiment of the present disclosure, where the present embodiment is applicable to a situation of obtaining a spatial polygon area, and a specific structure of the spatial polygon area determining device is as follows:
a boundary line segment determining module 310, configured to obtain a target boundary point of a space plane polygon, and determine at least one boundary line segment;
a plane normal vector obtaining module 320, configured to obtain a plane normal vector of the spatial plane polygon;
and the space polygon area determining module 330 is configured to determine the unit areas corresponding to the boundary line segments according to the boundary line segments and the normal vector, and add up the unit areas to obtain the area of the space polygon.
According to the technical scheme of the embodiment, at least one boundary line segment is determined by obtaining the target boundary point of the space polygon, the plane normal vector of the space plane polygon is obtained according to the boundary line segment, the unit area corresponding to each boundary line segment is determined according to each boundary line segment and the normal vector, the unit areas corresponding to each boundary line segment are accumulated to obtain the area of the space polygon, and the area of the space polygon can be directly calculated by obtaining the target boundary point of the space polygon. Therefore, the technical scheme of the application solves the problem that the traditional algorithm can only be applied to the field of two-dimensional plane design and cannot be applied to the field of three-dimensional space, realizes the direct calculation of the space polygon area, improves the efficiency of calculating the space polygon area, and improves the universality of the method for calculating the space polygon area.
Optionally, the spatial polygon area determining module 330 includes:
and the unit area determining unit is used for determining the unit area corresponding to the boundary line segment according to the boundary line segment and the normal vector based on the Stokes formula.
Optionally, the boundary line segment determining module 310 includes:
the target boundary point arrangement unit is used for sequentially arranging all the target boundary points according to the spatial positions of the target boundary points on the spatial plane polygon, and the arrangement sequence of the target boundary points adjacent to the spatial positions is adjacent;
a continuous target boundary point determining unit, configured to determine any two continuous target boundary points as a boundary line segment in the arrangement order;
and the head and tail target boundary point determining unit is used for determining the head target boundary point and the tail target boundary point as a boundary line segment in the arrangement sequence.
Optionally, the plane normal vector obtaining module 320 includes:
a target boundary point obtaining unit for obtaining three target boundary points from each target boundary point;
the direction vector determining unit is used for determining two direction vectors according to the three target boundary points;
and the plane normal vector determining unit is used for determining the plane normal vector of the space plane polygon according to the two direction vectors.
Optionally, the boundary line segment determining module 310 further includes:
and the calculation alarm unit is used for performing calculation alarm under the condition that the number of the target boundary points of the space plane polygon is less than three.
Optionally, the spatial planar polygon comprises a three-dimensional geometrically closed area.
The device for determining the area of the space polygon, provided by the embodiment of the application, can execute the method for determining the area of the space polygon provided by any embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present disclosure, as shown in fig. 5, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of the processors 410 in the electronic device may be one or more, and one processor 410 is taken as an example in fig. 5; the processor 410, the memory 420, the input device 430 and the output device 440 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 5.
The memory 420 serves as a computer-readable storage medium, and may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the spatial polygon area determination method in the embodiments of the present application (e.g., the boundary line segment determination module 310, the plane normal vector acquisition module 320, and the spatial polygon area determination module 330). The processor 410 executes software programs, instructions and modules stored in the memory 420 to execute various functional applications and data processing of the electronic device, that is, to implement the above-described method for determining the spatial polygon area.
The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 420 can further include memory located remotely from the processor 410, which can be connected to electronic devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 430 may be used to receive input character information and generate key signal inputs related to user settings and function control of the electronic device. The output device 440 may include a display device such as a display screen.
EXAMPLE five
A storage medium containing computer-executable instructions for performing a method for spatial polygon area determination when executed by a computer processor, the method comprising:
acquiring target boundary points of a space plane polygon, and determining at least one boundary line segment; acquiring a plane normal vector of a spatial plane polygon; and determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the method for determining a spatial polygon area provided in any embodiment of the present application.
From the above description of the embodiments, it is obvious for those skilled in the art that the present application can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute the methods described in the embodiments of the present application.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the application.
It is to be noted that the foregoing is only illustrative of the presently preferred embodiments and application of the principles of the present invention. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. A method for determining the area of a spatial polygon, comprising:
acquiring target boundary points of a space plane polygon, and determining at least one boundary line segment;
acquiring a plane normal vector of the space plane polygon;
and determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
2. The method of claim 1, wherein determining the area of the cell corresponding to each of the boundary line segments according to each of the boundary line segments and the normal vector comprises:
and determining the area of a unit corresponding to the boundary line segment according to the boundary line segment and the normal vector based on a Stokes formula.
3. The method of claim 2, wherein determining at least one boundary line segment comprises:
sequentially arranging each target boundary point according to the spatial position of the target boundary point on the spatial plane polygon, wherein the arrangement sequence of the target boundary points adjacent to each other in spatial position is adjacent to each other;
in the arrangement sequence, determining any two continuous target boundary points as a boundary line segment;
in the arrangement order, the first target boundary point and the last target boundary point are determined as a boundary line segment.
4. The method of claim 1, wherein the obtaining a normal vector of a plane of the spatial planar polygon comprises:
acquiring three target boundary points from each target boundary point;
determining two direction vectors according to the three target boundary points;
and determining a plane normal vector of the space plane polygon according to the two direction vectors.
5. The method of claim 1, after obtaining the target boundary points of the spatial plane polygon, further comprising:
and under the condition that the number of the target boundary points of the space plane polygon is less than three, performing calculation alarm.
6. The method of claim 1, wherein the spatial planar polygon comprises a three-dimensional geometrically closed area.
7. An apparatus for determining a spatial polygon area, comprising:
the boundary line segment determining module is used for acquiring target boundary points of the space plane polygon and determining at least one boundary line segment;
the plane normal vector acquisition module is used for acquiring a plane normal vector of the space plane polygon;
and the space polygon area determining module is used for determining the unit area corresponding to each boundary line segment according to each boundary line segment and the normal vector, and accumulating to obtain the area of the space polygon.
8. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of spatial polygon area determination of any of claims 1-6.
9. A computer-readable storage medium, having stored thereon computer instructions for causing a processor to execute a method for spatial polygon area determination according to any one of claims 1-6.
10. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method for spatial polygon area determination according to any one of claims 1-6.
CN202210330805.7A 2022-03-30 2022-03-30 Method and device for determining spatial polygon area, electronic equipment and storage medium Pending CN114742877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210330805.7A CN114742877A (en) 2022-03-30 2022-03-30 Method and device for determining spatial polygon area, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210330805.7A CN114742877A (en) 2022-03-30 2022-03-30 Method and device for determining spatial polygon area, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114742877A true CN114742877A (en) 2022-07-12

Family

ID=82280063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210330805.7A Pending CN114742877A (en) 2022-03-30 2022-03-30 Method and device for determining spatial polygon area, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114742877A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070126739A1 (en) * 2005-12-05 2007-06-07 Microsoft Corporation Vector-based geometric polygon schema
CN107122540A (en) * 2017-04-25 2017-09-01 哈尔滨工业大学 A kind of ground topographic support requirement analysis system and analysis method based on Stokes integration method
CN111603772A (en) * 2020-05-20 2020-09-01 腾讯科技(深圳)有限公司 Area detection method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070126739A1 (en) * 2005-12-05 2007-06-07 Microsoft Corporation Vector-based geometric polygon schema
CN107122540A (en) * 2017-04-25 2017-09-01 哈尔滨工业大学 A kind of ground topographic support requirement analysis system and analysis method based on Stokes integration method
CN111603772A (en) * 2020-05-20 2020-09-01 腾讯科技(深圳)有限公司 Area detection method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
成基华: "空间任意平面多边形面积快速算法及在CAD开发中的应用", 经济管理与干部教育, no. 01, 31 March 1997 (1997-03-31), pages 9 - 11 *
罗秋实等: "河流数值模拟技术及工程应用", 31 August 2012, 黄河水利出版社, pages: 94 *

Similar Documents

Publication Publication Date Title
Fabri et al. CGAL: The computational geometry algorithms library
JP2642070B2 (en) Method and system for generating quadrilateral mesh
US20120320087A1 (en) System and Methods for Parallelizing Polygon Overlay Computation in Multiprocessing Environment
CN112215308B (en) Single-order detection method and device for hoisted object, electronic equipment and storage medium
Escobar et al. Several aspects of three-dimensional Delaunay triangulation
CN104809760A (en) Depth-first strategy based method for automatically constructing geo-spatial three-dimensional outline
Teng et al. IDEAL: a vector-raster hybrid model for efficient spatial queries over complex polygons
CN114742877A (en) Method and device for determining spatial polygon area, electronic equipment and storage medium
CN113034347A (en) Oblique photographic image processing method, device, processing equipment and storage medium
CN109949421B (en) Triangular net cutting method and device
WO2004053741A1 (en) Method of calculating intersecions between triangle and line segment and progam therefor
CN112288759B (en) Boundary extraction method, device, equipment and storage medium
Liu et al. An interactive indoor 3D reconstruction method based on conformal geometry algebra
CN110917624B (en) Path determination method, device and equipment
CN111524446B (en) Data processing method and device, electronic equipment and readable storage medium
CN113670253A (en) Space target posture inversion method and device, computing equipment and storage medium
CN109000650B (en) Method and device for determining relative position of ground object
Xiao et al. Shell: A spatial decomposition data structure for ray traversal on GPU
CN117195334B (en) Multi-segment line width expansion method and device, storage medium and computer equipment
Krishnan et al. Interactive boundary computation of boolean combinations of sculptured solids
CN115690120B (en) Method, apparatus, device, medium and program product for generating three-dimensional grid
Mendes et al. An efficient obstacle detection approach for organized point clouds
US10297075B2 (en) Method of processing image data
Singh et al. A pre-processing algorithm for faster convex hull computation
Hong et al. Implementation of 3D deformable objects on smart devices using FFD-AABB algorithm

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