GH programming method for batch uniform subdivision surface normal direction
By batch loading and decomposing the subdivided surfaces of curtain wall modeling in the GH system, and using GH programming methods to judge and sort the normal direction, the problem of inconsistent normal direction in Rhino software and GH platform is solved, and the rapid reconstruction of the curtain wall system is achieved The consistency with the results improves the operational efficiency and the recognizability of the results.
Patent Information
- Application Number
- CN202411241399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-27
AI Technical Summary
In Rhino software and GH platforms, when batch processing of surface normal directions, the existing technology cannot effectively unify the normal direction, resulting in inconsistent normal directions of curtain wall modeling before and after flip, and manual operation is time-consuming and inefficient, so it is impossible to Consistent between different software.
By loading the subdivided faces modeled in curtain walls in batches, decompose them into point, line and surface elements, and reconstructing the forward and inverse geometric surfaces in the GH system, using the center and Z-axis coordinate sorting method or the center distance method of the external volume Determine the normal direction, realize batch unification and sorting of the normal direction, and ensure the consistency of the results after the flip operation.
The judgment and unity of the normal direction of the subdivided surface is achieved in a very short time, and the problems of confusion and inconsistent flips are solved. The results provided can be effectively identified in different software, improving the reconstruction efficiency of the curtain wall system. and accuracy.
Smart Images

Figure CN119201063A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of modeling, and in particular to a GH programming method for batch unifying normal directions of subdivision surfaces. Background Art
[0002] In various mainstream modeling software, the normal direction of the surface will directly affect the results of surface offset and stretching, as well as the results of most surface-based parametric analysis. Therefore, unifying the normal direction is a very important part of the parametric workflow. Rhino has a "flip" command that can flip the normal direction of an open surface, but this command does not have the ability to determine the normal direction of multiple objects. This operation can correct all results involving normal direction in Rhino.
[0003] 1. When dealing with large quantities of normals, the flip command in Rhino software can only select objects manually, which is very time-consuming. Moreover, the normal direction corrected in the Rhino environment will not change the result after the surface is imported into the GH platform. As a result, the normal flip problem becomes an unsolvable problem when performing parametric analysis.
[0004] 2. The GH platform has another plug-in "Lunchbox", which has a "reverseSurface Direction" operator. The flipping effect can be achieved by modifying the UV coordinates of the surface itself, but when the normal direction of the subdivision surface is chaotic, this operator cannot provide an identification function. Summary of the invention
[0005] (I) Purpose of the invention
[0006] In order to solve the technical problems existing in the background technology, the present invention proposes a GH programming method for batch unifying the normal direction of subdivision surfaces, which has the characteristics of batch confirmation of normals of subdivision surfaces and rapid completion of the reconstruction of the curtain wall system, and solves the problems of confusion in the normal direction of subdivision surfaces and inconsistency before and after the curtain wall modeling is flipped.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention provides a GH programming method for batch unifying the normal directions of subdivision surfaces, comprising the following steps:
[0009] Step 1: Batch load the subdivision surfaces of curtain wall modeling, and decompose each subdivision surface into point, line and surface elements at the data level;
[0010] Step 2: Load the point elements into the point-based surface generator in the GH system, reconstruct the positive and negative geometric surfaces in a single data layer, and store them in two different databases;
[0011] Step 3: Take the centroid of the subdivision surface as the starting point, and generate two straight lines (La, Lb) corresponding to the positive and negative directions of the normal line along the tangent plane corresponding to the centroid of the subdivision surface. Select the judgment method in GH programming according to the curtain wall type to assist in the judgment of the positive and negative directions of the normal line.
[0012] Step 4: When the subdivision surfaces of the curtain wall modeling are both outward or inward inclined, select the endpoint Z-axis coordinate sorting method, confirm the positive and negative directions of the normal lines and sort them, and select the appropriate geometric surface in the positive and negative databases according to the actual shape of the curtain wall;
[0013] Step 5. When the subdivision surfaces of curtain wall modeling have both outward and inward inclinations, select the circumscribed volume center distance method, confirm the positive and negative directions of the normals and sort them, and select the appropriate geometric surface from the positive and negative databases based on the actual shape of the curtain wall.
[0014] Preferably, in step 1, the subdivision surface comes from the surface subdivision imported into the curtain wall modeling, the subdivision surface is a geometry defined by three or four points, and the combination of subdivision surfaces loaded in batches is the curtain wall modeling surface as a whole.
[0015] Preferably, in step 2, the point elements are loaded into a point-based surface generator in the GH system, and the geometric surface is reconstructed using the line elements as boundary indicator values and the surface elements as boundary thresholds.
[0016] Preferably, in step 2, the geometric surface has a front and a back side, and the corresponding front database stores data only including the front side geometric surface, and the back database stores data only including the back side geometric surface.
[0017] Preferably, in step three, the centroid of the subdivision surface is the average position of the mass of all points on the subdivision surface, wherein the starting points of the two straight lines (La, Lb) in the positive and negative directions of the generated normal are both the centroid point and have the same length.
[0018] Preferably, in step 4, when the subdivision surfaces of the curtain wall modeling are simultaneously outwardly inclined or simultaneously inwardly inclined, the endpoint Z-axis coordinate sorting method is selected;
[0019] Use GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and extract their Z-axis coordinates (Za, Zb). Get the distance difference between the Z-axis coordinates (Za, Zb) and the centroid and take the absolute value. The one with a larger absolute value is the positive direction normal, otherwise it is the negative direction normal.
[0020] Preferably, step four also includes sorting of subdivision surfaces, uniformly sorting the positive direction normals under the Z-axis coordinate, calling the geometric surfaces in the positive database according to the sorting, and combining the geometric surfaces with sorting numbers into a curtain wall modeling surface similar to the actual shape of the curtain wall.
[0021] Preferably, in step 5, when the subdivision surface of curtain wall modeling has both outward inclination (normal facing downward) and inward inclination (normal facing upward), the Z-axis coordinate sorting method cannot effectively determine the inward and outward inclination, and the circumscribed volume center distance method is selected.
[0022] Preferably, in step five, the circumscribed volume center distance method uses all the subdivision surfaces initially loaded by programming to generate the overall circumscribed volume and confirm its center (Cb), and uses GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and then compares the distances between the endpoints (Pa, Pb) of the straight lines and the center (Cb) of the circumscribed volume. The normal line with a larger distance difference is the positive direction normal line, and vice versa. After the distance difference is judged in batches, the positive direction normal lines are uniformly sorted, and the geometric surfaces in the positive database are retrieved according to the sorting, and the geometric surfaces with sorting numbers are combined into curtain wall modeling surfaces similar to the actual shape of the curtain wall.
[0023] Preferably, the positive and negative directions of the normals of each subdivision surface are obtained through judgment within GH programming, and geometric surfaces are called in batches to generate curtain wall modeling surfaces that can be recognized by Rhino and GH software, which have normal directions in a unified direction.
[0024] The above technical solution of the present invention has the following beneficial technical effects: designers can complete the judgment and unification of the positive and negative directions of the normals of the subdivision surface of the entire curtain wall system in a very short time, and assist in the unification of the curtain wall system before and after the flipping operation. At the same time, because programming actually uses reconstruction to solve the flipping problem, the resulting geometry can be effectively recognized when exported to different software. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of the GH programming method for batch unifying the normal directions of subdivided surfaces of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0027] like Figure 1 As shown, the present invention proposes a GH programming method for batch unifying the normal direction of subdivided surfaces, comprising the following steps:
[0028] Step 1: Batch load the subdivision surfaces of curtain wall modeling, and decompose each subdivision surface into point, line and surface elements at the data level;
[0029] Among them, the subdivision surface comes from the surface subdivision of the imported curtain wall modeling. The imported curtain wall modeling will generate several subdivision surfaces within the same face boundary threshold range. According to the position of the subdivision surface, the subdivision surface is divided into geometries defined by three or four points. The batch loaded subdivision surface combination as a whole is the curtain wall modeling surface.
[0030] Step 2: Load the point elements into the point-based surface generator in the GH system, reconstruct the positive and negative geometric surfaces in a single data layer, and store them in two different databases;
[0031] Load the point elements into the point-based surface generator in the GH system, use the line elements as the boundary indicator values, combine two point elements through the line elements, the line segments are straight lines or curves, the surface elements are the boundary thresholds, and the reconstructed geometric surface should be within the boundary threshold range, that is, the boundaries of the subdivision surface and the geometric surface are the same, each subdivision surface corresponds to a reconstructed geometric surface, and the reconstructed geometric surface has the same centroid position as the subdivision surface, the difference is that the positive and negative directions of the normals are not confirmed.
[0032] It can be understood that since the reconstructed geometric surface has both front and back sides, the data stored in the corresponding front database only includes the front geometric surface, and the back database only includes the back geometric surface. When calling, select any one of the front and back databases. When the combination of any one side of the geometric surface is completed, the other side of the geometric surface is also combined.
[0033] It should be added that: in two different databases, point, line and surface elements of the data plane are stored.
[0034] Step 3: Take the centroid of the subdivision surface as the starting point, and generate two straight lines (La, Lb) corresponding to the positive and negative directions of the normal line along the tangent plane corresponding to the centroid of the subdivision surface. Select the judgment method in GH programming according to the curtain wall type to assist in the judgment of the positive and negative directions of the normal line.
[0035] The centroid of the subdivision surface is the average position of the mass of all points on the subdivision surface, and the starting points of the two straight lines (La, Lb) in the positive and negative directions of the generated normal are both the centroid point, and the lengths of the two are the same.
[0036] When judging the direction of the normal, the so-called positive and negative are just a comparison based on the shape of the body. Taking a spherical surface as an example, the positive normal is generally understood as the direction from the center of the circle to the outside, and the negative normal is the direction from the outside to the center of the circle.
[0037] It should be noted that GH programming includes the endpoint Z-axis coordinate sorting method and the circumscribed volume center distance method, both of which are used to determine the positive and negative directions of the normal line.
[0038] Step 4: When the subdivision surfaces of the curtain wall modeling are both outward or inward inclined, select the endpoint Z-axis coordinate sorting method, confirm the positive and negative directions of the normal lines and sort them, and select the appropriate geometric surface in the positive and negative databases according to the actual shape of the curtain wall;
[0039] When the subdivision surfaces of the curtain wall modeling are inclined outward or inward at the same time, the endpoint Z-axis coordinate sorting method is selected, that is, the curtain wall surface inclination angle interval is small and does not include the 0 degree range perpendicular to the ground. The optimal range of the curtain wall surface inclination angle interval is 0-15 degrees;
[0040] Use GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and extract their Z-axis coordinates (Za, Zb). Get the distance difference between the Z-axis coordinates (Za, Zb) and the centroid and take the absolute value. The one with a larger absolute value is the positive direction normal, otherwise it is the negative direction normal.
[0041] The normal positive and negative direction data of each subdivision surface are obtained through repeated calculations, wherein the sorting is carried out through the initial numbering of the initial positive and negative database geometric surfaces. During the sorting process, the positive direction normals are uniformly sorted under the Z-axis coordinate, and the geometric surfaces in the positive database are retrieved according to the sorting. The normal directions of the geometric surfaces of the curtain wall modeling surfaces are always consistent, and the geometric surfaces are uniformly called in batches to generate a geometric surface combination that matches the actual shape of the curtain wall.
[0042] It can be understood that calling the inverse database unified as the reverse normal line can also generate a geometric surface combination that matches the actual shape of the curtain wall.
[0043] Step 5. When the subdivision surfaces of curtain wall modeling have both outward and inward inclinations, select the circumscribed volume center distance method, confirm the positive and negative directions of the normals and sort them, and select the appropriate geometric surface from the positive and negative databases based on the actual shape of the curtain wall.
[0044] Among them, when the subdivision surface of curtain wall modeling has both outward inclination (normal facing downward) and inward inclination (normal facing upward), the Z-axis coordinate sorting method cannot effectively judge the inward and outward inclination, and the circumscribed volume center distance method is selected.
[0045] It can be understood that the circumscribed volume center distance method uses all the subdivision surfaces initially loaded by programming to generate the overall circumscribed volume and confirm its center (Cb), and uses GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and then compares the distance between the endpoints (Pa, Pb) of the straight lines and the center (Cb) of the circumscribed volume. The normal line with a larger distance difference is the positive direction normal line, and vice versa. After the distance difference is judged in batches, the positive direction normal lines are uniformly sorted, and the geometric surfaces in the positive database are retrieved according to the sorting, and the geometric surfaces with sorting numbers are combined into curtain wall modeling surfaces similar to the actual shape of the curtain wall.
[0046] In this embodiment, the positive and negative directions of the normals of each subdivision surface are obtained through judgment within the GH programming, and then the positive and negative directions of the normals of the reconstructed geometric surface are determined, and the geometric surfaces are called in batches and uniformly to generate curtain wall modeling surfaces that can be recognized by Rhino and GH software. The surfaces have a unified normal direction, which eliminates the tedious operation of manually selecting the normal selection objects for each subdivision surface, solves the problem of confusion in the positive and negative directions of normal selection, and assists in the unification of the curtain wall system before and after the flipping operation. At the same time, because programming actually uses reconstruction to solve the flipping problem, the resulting geometry provided can also be effectively recognized when exported to different software.
[0047] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
Claims
1. A GH programming method for batch unifying the normal direction of subdivision surfaces, characterized in that: The following steps are involved: Step 1: Batch load the subdivision surfaces of curtain wall modeling, and decompose each subdivision surface into point, line and surface elements at the data level; Step 2: Load the point elements into the point-based surface generator in the GH system, reconstruct the positive and negative geometric surfaces in a single data layer, and store them in two different databases; Step 3: Take the centroid of the subdivision surface as the starting point, and generate two straight lines (La, Lb) corresponding to the positive and negative directions of the normal line along the tangent plane corresponding to the centroid of the subdivision surface. Select the judgment method in GH programming according to the curtain wall type to assist in the judgment of the positive and negative directions of the normal line. Step 4: When the subdivision surfaces of the curtain wall modeling are both outward or inward inclined, select the endpoint Z-axis coordinate sorting method, confirm the positive and negative directions of the normal lines and sort them, and select the appropriate geometric surface in the positive and negative databases according to the actual shape of the curtain wall; Step 5. When the subdivision surfaces of curtain wall modeling have both outward and inward inclinations, select the circumscribed volume center distance method, confirm the positive and negative directions of the normals and sort them, and select the appropriate geometric surface from the positive and negative databases based on the actual shape of the curtain wall.
2. A GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: In step 1, the subdivision surface comes from the surface subdivision imported for curtain wall modeling. The subdivision surface is a geometry defined by three or four points. The combination of subdivision surfaces loaded in batches is the curtain wall modeling surface as a whole.
3. The GH programming method for batch unifying the normal direction of subdivided surfaces according to claim 1, characterized in that: In step 2, the point elements are loaded into the point-based surface generator in the GH system, and the geometric surface is reconstructed using the line elements as boundary indicator values and the surface elements as boundary thresholds.
4. A GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 3, characterized in that: In step 2, the geometric surface has a front and a back side, and the corresponding front database stores data only including the front geometric surface, and the back database stores data only including the back geometric surface.
5. The GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: In step 3, the centroid of the subdivision surface is the average position of the mass of all points on the subdivision surface, wherein the two straight lines (La, Lb) generated in the positive and negative directions of the normal line both start from the centroid point and have the same length.
6. A GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: In step 4, when the subdivision surfaces of the curtain wall modeling are both outward or inward inclined, select the endpoint Z-axis coordinate sorting method; Use GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and extract their Z-axis coordinates (Za, Zb). Get the distance difference between the Z-axis coordinates (Za, Zb) and the centroid and take the absolute value. The one with a larger absolute value is the positive direction normal, otherwise it is the negative direction normal.
7. A GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 6, characterized in that: Step 4 also includes sorting of subdivision surfaces. Under the Z-axis coordinate, the positive normals are uniformly sorted, and the geometric surfaces in the positive database are retrieved according to the sorting, and the geometric surfaces with sorting numbers are combined into curtain wall modeling surfaces similar to the actual shape of the curtain wall.
8. The GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: In step 5, when the subdivision surface of the curtain wall modeling has both outward inclination (normal facing downward) and inward inclination (normal facing upward), the Z-axis coordinate sorting method cannot effectively determine the inward and outward inclination, and the circumscribed volume center distance method is selected.
9. The GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: In step five, the circumscribed volume center distance method uses all the subdivision surfaces initially loaded by programming to generate the overall circumscribed volume and confirm its center (Cb), and uses GH's operator to decompose the endpoints (Pa, Pb) of two straight lines (La, Lb) in a data layer, and then compares the distance between the endpoints (Pa, Pb) of the straight lines and the center (Cb) of the circumscribed volume. The one with a large distance difference is the positive direction normal, and vice versa, it is the negative direction normal. After the distance difference is judged in batches, the positive direction normals are uniformly sorted, and the geometric surfaces in the positive database are retrieved according to the sorting, and the geometric surfaces with sorting numbers are combined into curtain wall modeling surfaces similar to the actual shape of the curtain wall.
10. A GH programming method for batch unifying the normal direction of subdivision surfaces according to claim 1, characterized in that: The positive and negative directions of the normals of each subdivision surface are obtained through judgment within GH programming, and geometric surfaces are called in batches to generate curtain wall modeling surfaces that can be recognized by Rhino and GH software, which have a unified normal direction.