Rotating shaft type identification method of NX rotation feature, electronic terminal and storage medium

By utilizing the NX secondary development interface and topology element matching method in the Siemens NX platform, the rotation axis type of rotation features is identified, solving the problem of not being able to obtain the rotation axis type in the existing technology. This achieves accurate identification of rotation features and acquisition of topology relationships, improving data conversion efficiency.

CN121580118APending Publication Date: 2026-02-27HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511755447.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In the Siemens NX platform, existing technologies cannot obtain information about the type of rotary axis, resulting in the inability to obtain complete information about the design intent of the part, especially in the conversion of model data from heterogeneous CAD systems.

Method used

The parent features of the rotation feature are obtained by traversing through the NX secondary development interface. Combined with the linked storage structure and topology element matching method, the type of rotation axis is identified, including the reference axis, the base feature and the sketch line, etc. The matching of the rotation axis with the solid edge or the sketch line is determined by the preset tolerance.

Benefits of technology

It enables accurate acquisition of the type information of rotary axes in the Siemens NX platform, meets the requirement of acquiring the reference topology relationship of rotary feature parts, and improves the data conversion efficiency of heterogeneous CAD systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580118A_ABST
    Figure CN121580118A_ABST
Patent Text Reader

Abstract

The invention discloses a rotating shaft type identification method based on NX rotating characteristics, an electronic terminal and a storage medium. The method comprises the steps that the NX rotating characteristics and rotating shaft geometric information thereof are acquired; traversing by using an NX secondary development interface to obtain a parent feature of the NX rotation feature; performing parent feature combination classification according to features included in the parent features; according to the rotating shaft geometric information, in combination with a topological element matching method, performing rotating shaft type identification on different parent feature combination types, and obtaining a rotating shaft type identification result of the NX rotating feature; wherein the rotating shaft geometric information comprises a rotating shaft direction vector and a rotating shaft three-dimensional origin coordinate; the features contained in the parent features comprise reference axis features and / or matrix features. The rotating shaft type identification of the NX rotating characteristic can be realized, and the requirement of obtaining the reference topological relation of the part containing the NX rotating characteristic can be met at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a rotation axis type identification method of an NX rotation feature, an electronic terminal and a storage medium, and belongs to the technical field of computer-aided design. BACKGROUND

[0002] A computer-aided design (CAD) system such as Siemens NX, SolidWorks and the like changes a traditional design mode and is widely applied to product design and management in multiple fields such as architecture, aerospace, shipbuilding and automobile. However, there is a model data exchange interoperability problem between different systems, which leads to difficulty in data sharing and integration, especially affecting multi-system collaboration.

[0003] A rotation feature is one of the most basic features in a CAD system. However, based on an NX11.0 platform, only three-dimensional origin coordinate data and three-dimensional direction vector data of a rotation axis can be obtained by using an NX secondary development interface, and type information of the rotation axis cannot be obtained, that is, reference topological relationship of the rotation axis cannot be obtained, which makes it difficult to obtain complete part design intention information.

[0004] Therefore, based on analysis of a data organization architecture of a part feature in NX11.0 and in combination with an existing NX secondary development interface, a rotation axis type identification method of a rotation feature based on NX secondary development is designed. SUMMARY

[0005] The application aims to overcome the deficiencies in the prior art and provide a rotation axis type identification method of an NX rotation feature, an electronic terminal and a storage medium, which can identify the rotation axis type of the NX rotation feature and meet the requirement of obtaining reference topological relationship of an NX rotation feature part.

[0006] To achieve the above object, the application is implemented by using the following technical scheme: In a first aspect, the application provides a rotation axis type identification method of an NX rotation feature, which comprises the following steps: Obtaining the NX rotation feature and its rotation axis geometric information; Obtaining the parent feature of the NX rotation feature by using an NX secondary development interface; combining the features contained in the parent feature; According to the rotation axis geometric information, in combination with a topological element matching method, a rotation axis type of different parent feature combination types is identified to obtain a rotation axis type identification result of the NX rotation feature; The rotation axis geometric information includes a rotation axis direction vector and a rotation axis three-dimensional origin coordinate; and the features contained in the parent feature include a reference axis feature and / or a base feature.

[0007] In combination with the first aspect, further, before the parent feature container is traversed and acquired by using an NX secondary development interface, the parent feature container is established and initialized based on a chain storage structure and an NX secondary development interface, and is used to store parent feature object information of the parent feature.

[0008] In combination with the first aspect, further, the parent feature combination classification according to the features contained in the parent feature includes: If the parent feature contains both the base feature and the reference axis feature, it is determined as parent feature combination type one; if the parent feature contains the base feature but does not contain the reference axis feature, it is determined as parent feature combination type two; If the parent feature does not contain the base feature but contains the reference axis feature, it is determined as parent feature combination type three; If the parent feature does not contain the base feature and does not contain the reference axis feature, it is determined as parent feature combination type four.

[0009] In combination with the first aspect, further, the rotation axis type identification according to the rotation axis geometric information, in combination with a topological element matching method, for different parent feature combination types to obtain a rotation axis type identification result of the NX rotation feature includes: For the parent feature combination type one, the rotation axis geometric information is matched with all entity edges of the base feature: if the rotation axis geometric information exists and is matched with an entity edge, the rotation axis type is identified as a reference entity edge type; otherwise, the rotation axis type is identified as a reference reference axis type; For the parent feature combination type two, the rotation axis geometric information is matched with all entity edges of the base feature: if the rotation axis geometric information exists and is matched with an entity edge, the rotation axis type is identified as a reference entity edge type; otherwise, the rotation axis geometric information is matched with a sketch straight line in all sketch parent features: if the rotation axis geometric information exists and is matched with a sketch straight line, the rotation axis type is identified as a reference sketch straight line type; otherwise, the rotation axis type is identified as a given reference direction and position type; For the parent feature combination type three, the rotation axis type is directly identified as a reference reference axis type; For the parent feature combination type four, match the rotation axis geometry information with sketch straight lines in all sketch parent features: if the rotation axis geometry information matches a sketch straight line, the rotation axis type is identified as a reference sketch straight line type; otherwise, the rotation axis type is identified as a given reference direction and position type.

[0010] With reference to the first aspect, further, the matching the rotation axis geometry information with all solid edges of the base body feature comprises: According to the rotation axis three-dimensional origin point coordinate in the rotation axis geometry information, the minimum distance from the rotation axis three-dimensional origin point coordinate to each solid edge is calculated by using the NX function UF_MODL_ask_minimum_dist; wherein the solid edge is stored in a topological edge storage container, and the topological edge storage container is used to acquire and store all solid edges of the base body feature by using an NX secondary development interface; If the minimum distance from the rotation axis three-dimensional origin point coordinate to the current solid edge is less than a preset tolerance, it indicates that the rotation axis three-dimensional origin point is on the current solid edge, and then the direction judgment is continued according to the rotation axis direction vector and the start point and the end point of the current solid edge, and the direction judgment result is used to determine whether the rotation axis geometry information matches the solid edge; If the minimum distance from the rotation axis three-dimensional origin point coordinate to all solid edges is greater than or equal to the preset tolerance, it indicates that the rotation axis three-dimensional origin point is not on any solid edge in the topological edge storage container, and the rotation axis geometry information does not match the solid edge.

[0011] With reference to the first aspect, further, the direction judgment according to the rotation axis direction vector and the start point and the end point of the current solid edge comprises: The absolute value of the normalized rotation axis direction vector in the rotation axis geometry information is obtained to obtain axisDir; The three-dimensional direction vector of the current solid edge is calculated and normalized according to the start point and the end point of the current solid edge, and the absolute value of the normalized three-dimensional direction vector is obtained to obtain EdgeDir; The dot product of axisDir and EdgeDir is calculated to obtain dotA, and if dotA is less than the square of the preset tolerance, it indicates that the rotation axis geometry information matches the current solid edge, and the rotation axis geometry information matches the solid edge; For all solid edges in the topological edge storage container, if the calculated dotA is greater than or equal to the square of the preset tolerance, it indicates that the rotation axis geometry information does not match the solid edge.

[0012] With reference to the first aspect, further, the matching the rotation axis geometry information with sketch straight lines in all sketch parent features comprises: calculate squares of distances DistA and DistB between the origin point coordinate of the rotation axis and the start point coordinate and the end point coordinate of each sketch line in the sketch line storage container respectively; wherein the sketch line storage container obtains and stores all sketch lines in the current sketch by using the NX secondary development interface; If any of DistA and DistB is less than the square of the preset tolerance, continue to perform direction judgment according to the rotation axis direction vector, the start point coordinate and the end point coordinate of the sketch line, and determine whether the rotation axis geometric information exists a matching sketch line based on the direction judgment result; If all DistA and all DistB are greater than or equal to the square of the preset tolerance, it indicates that the rotation axis geometric information does not exist a matching sketch line.

[0013] In combination with the first aspect, further, the direction judgment according to the rotation axis direction vector, the start point coordinate and the end point coordinate of the sketch line comprises: normalize the rotation axis direction vector to obtain axisDir; calculate a three-dimensional direction vector of the sketch line according to the start point coordinate and the end point coordinate of the sketch line, normalize the three-dimensional direction vector, and take an absolute value to obtain LineDir; perform dot product calculation on LineDir and axisDir to obtain dotB, and if there is dotB less than the square of the preset tolerance, it indicates that the rotation axis geometric information exists a matching sketch line; For all sketch lines in the sketch line storage container, if the calculated dotB is greater than or equal to the square of the preset tolerance, it indicates that the rotation axis geometric information does not exist a matching sketch line.

[0014] In the second aspect, the present application provides an electronic terminal, comprising a processor and a memory connected to the processor, and the memory stores a computer program, when the computer program is executed by the processor, the steps of the method of any one of the preceding aspects are executed.

[0015] In the third aspect, the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the method of any one of the preceding aspects.

[0016] Compared with the prior art, the present application has the following beneficial effects: The NX rotating feature rotating shaft type identification method, the electronic terminal and the storage medium provided by the application are based on traversing the parent feature of the rotating feature by using the NX secondary development interface, the rotating shaft type is identified according to the parent feature combination type, and the topological element matching method is combined, so that the rotating shaft feature information can be accurately obtained in the identification process, thereby realizing the rotating shaft type identification of the NX rotating feature and meeting the requirement of obtaining the topological relationship of the NX rotating feature part. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 is a flowchart of a parent feature combination type classification provided by an embodiment of the application; Figure 2 is a rotating shaft type identification flowchart of a parent feature combination type one provided by an embodiment of the application; Figure 3 is a rotating shaft type identification flowchart of a parent feature combination type two provided by an embodiment of the application; Figure 4 is a rotating shaft type identification flowchart of a parent feature combination type four provided by an embodiment of the application; Figure 5 is a rotating shaft matching base feature topological entity edge flowchart provided by an embodiment of the application; Figure 6 is a rotating shaft matching sketch line flowchart provided by an embodiment of the application. DETAILED DESCRIPTION

[0018] The technical scheme of the application will be described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific features in the embodiments and the specific embodiments of the application are detailed descriptions of the technical scheme of the application, and are not limitations of the technical scheme of the application. In the case of no conflict, the technical features in the embodiments and the specific embodiments of the application can be combined with each other.

[0019] The term "and / or" in this paper is only a description of the association relationship between the associated objects, which means that there are three kinds of relationships, for example, A and / or B, which means that there are three kinds of situations, that is, A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are in an "or" relationship.

[0020] The embodiment of the application provides an NX rotating feature rotating shaft type identification method, which comprises the following steps: Step A1: obtaining the NX rotating feature and its rotating shaft geometric information; wherein the rotating shaft geometric information comprises a rotating shaft direction vector and a rotating shaft three-dimensional origin coordinate; the NX rotating feature can be obtained by using the NX secondary development interface.

[0021] Step A2: traverse to obtain the parent feature of the NX rotation feature by using the NX secondary development interface; The so-called "parent feature" refers to a basic feature relied on or referenced by other features (child features), which is a prerequisite or reference for the generation of child features, and the change of its parameters or topological structure will affect the child features.

[0022] As an embodiment of the present application, before traversing to obtain the parent feature, first, based on the chain storage structure and the NX secondary development interface, a rotation parent feature storage container (hereinafter referred to as the parent feature container) is established and initialized for storing the parent feature object information obtained by traversing the parent feature of the NX rotation feature; then the NX rotation feature is input by the NX secondary development interface, all parent features of the NX rotation feature are traversed to obtain the parent feature object information of the parent feature, and the parent feature object information is stored in the parent feature container.

[0023] Step A3: parent feature combination classification according to the features contained in the parent feature; The features contained in the parent feature include reference axis features and / or base features, and further, the base features can include stretching, rotating and sweeping features.

[0024] As shown in Figure 1 , a flowchart of parent feature combination type classification is provided, in this embodiment, according to whether the parent feature contains reference axis features and base features, a total of four parent feature combination types are obtained, as follows: Parent feature combination type one: the parent feature contains base features and reference axis features; Parent feature combination type two: the parent feature contains base features but does not contain reference axis features; Parent feature combination type three: the parent feature does not contain base features but contains reference axis features; Parent feature combination type four: the parent feature does not contain base features and does not contain reference axis features.

[0025] It should be noted that in the parent feature combination type classification process, if the parent feature contains base features, the base feature object is obtained at the same time and named as SolidFeature; if the parent feature contains reference axis features, the reference axis feature object is obtained at the same time and named as DatumAxis.

[0026] Step A4: according to the rotation axis geometric information, combining the topological element matching method, the rotation axis type of different parent feature combination types is identified to obtain the rotation axis type identification result of the NX rotation feature; According to the conversion needs of heterogeneous CAD data and the creation method of most rotation features in NX11.0, the present embodiment summarizes four types of rotation axis types as shown in Table 1: Table 1: .

[0027] As shown in Figure 2 , a parent feature combination type one rotation axis type identification process schematic diagram is provided, specifically comprising the following steps: For the parent feature combination type one: If the rotation axis geometric information exists an entity edge matched therewith, the rotation axis type is identified as a reference entity edge type, and the type is named as "RefEdge"; if the rotation axis geometric information does not exist an entity edge matched therewith, the rotation axis type is identified as a reference datum axis type, and the type is named as "DatumAxis".

[0028] As shown in Figure 3 , a parent feature combination type two rotation axis type identification process schematic diagram is provided, specifically comprising the following steps: For the parent feature combination type two: If the rotation axis geometric information exists an entity edge matched therewith, the rotation axis type is identified as a reference entity edge type, and the type is named as "RefEdge"; otherwise, the rotation axis geometric information is matched with sketch lines in all sketch parent features (i.e. sketch type parent features): if there is a sketch line matched therewith, the rotation axis type is identified as a reference sketch line type, and the type is named as "SketchLine"; if there is no sketch line matched therewith, the rotation axis type is identified as a given datum direction and position type, and the type is named as "PointDir".

[0029] For the parent feature combination type three, the rotation axis type is directly identified as a reference datum axis type, and the type is named as "DatumAxis".

[0030] As shown in Figure 4 , a parent feature combination type four rotation axis type identification process schematic diagram is provided, specifically comprising the following steps: For the parent feature combination type four: According to the rotation axis geometric information, all sketch lines in all sketch parent features are matched, if matched with a sketch line, the rotation axis type is identified as a reference sketch line type, and the type is named as "SketchLine"; if no sketch line is matched, the rotation axis type is identified as a given datum direction and position type, and the type is named as "PointDir".

[0031] As shown in Figure 5As shown, a method flow diagram for matching the rotation axis geometry information with all entity edges of the base feature is provided. It should be noted that before performing the method steps, a topological edge storage container AxiEdge is first established and initialized, and then all entity edges of the base feature are obtained using the NX secondary development interface and stored in the topological edge storage container AxiEdge. It is assumed that the topological edge storage container AxiEdge contains M entity edges in total, the preset tolerance is 0.001, AxiEdge(i) represents the i-th entity edge, and the initial value of i is set to 1. The following steps are performed: Step B1: Obtain the AxiEdge(i) object from the topological edge storage container AxiEdge, and calculate the minimum distance MinDist from the rotation axis three-dimensional origin coordinate to the AxiEdge(i) object using the NX function UF_MODL_ask_minimum_dist based on the rotation axis three-dimensional origin coordinate information in the rotation axis geometry information.

[0032] Step B2: If the minimum distance MinDist from the rotation axis three-dimensional origin coordinate to the current entity edge is less than the preset tolerance 0.001, it indicates that the rotation axis three-dimensional origin is on the current entity edge, and step B3 is skipped. If the minimum distance MinDist from the rotation axis three-dimensional origin coordinate to the current entity edge is greater than or equal to the preset tolerance 0.001, it is further determined whether i is less than M: if i is less than M, i is set to i+1, and step B1 is skipped to recalculate the minimum distance MinDist; if i=M, it indicates that the minimum distance MinDist from the rotation axis three-dimensional origin coordinate to all entity edges is greater than or equal to the preset tolerance 0.001, and the rotation axis three-dimensional origin is not on any entity edge in the topological edge storage container. The rotation axis geometry information does not exist with the matching entity edge. Step B3: Continue to determine the direction based on the rotation axis direction vector and the start point and end point of the AxiEdge(i) object, and determine whether the rotation axis geometry information exists with the matching entity edge based on the direction determination result.

[0033] Continuing to refer to Figure 5 As an embodiment of the present application, the direction determination based on the rotation axis direction vector and the start point and end point of the AxiEdge(i) object in step B3 to determine whether the rotation axis geometry information exists with the matching entity edge based on the direction determination result specifically includes the following steps: Step B3-1: Calculate the three-dimensional direction vector of the AxiEdge(i) object based on the start point and end point thereof, normalize it, and then take the absolute value to obtain EdgeDir. Step B3-2: Normalize the rotation axis direction vector in the rotation axis geometry information and take the absolute value to obtain axisDir; Step B3-3: Calculate the dot product of EdgeDir and axisDir to obtain dotA; If dotA is less than the square of the tolerance 0.000001, it indicates that the rotation axis geometry information matches the current entity edge, and the rotation axis geometry information exists an entity edge AxiEdge(i) that matches it. If dotA is greater than or equal to the square of the tolerance 0.000001, further determine whether i is less than M: if i is less than M, let i = i + 1, then jump to step B1 to recalculate the minimum distance MinDist; if i = M, it indicates that for all entity edges in the topological edge storage container, the calculated dotA is greater than or equal to the square of the preset tolerance 0.000001, and the rotation axis geometry information does not exist an entity edge that matches it.

[0034] As shown in Figure 6 A method flow diagram for matching the rotation axis geometry information with all sketch lines in the sketch parent feature is provided, in this embodiment, before executing the method steps, first establish and initialize a sketch line storage container Lines, then use the NX secondary development interface to obtain all sketch line elements in the current sketch and store them in the sketch line storage container Lines; assuming that the sketch line storage container contains N lines in total, the same preset tolerance is 0.001, Lines (j) represents the jth sketch line, let the initial value of j be equal to 1, execute the following steps: Step C1: Obtain the Lines (j) object from the sketch line storage container Lines to obtain the start point coordinate StartPoint and the end point coordinate EndPoint of the Lines (j) object, calculate the square of the distance between StartPoint and AxisOrgin to obtain DistA, and calculate the square of the distance between EndPoint and AxisOrgin to obtain DistB according to the rotation axis three-dimensional origin coordinate AxisOrgin in the rotation axis geometry information.

[0035] Step C2: If either of DistA and DistB is less than the square of the tolerance 0.000001, jump to step C3; If neither of DistA and DistB is less than the square of the tolerance 0.000001, it indicates that the current sketch line does not match the rotation axis geometry information; further determine whether j is less than N: if j is less than N, let j = j + 1, jump to step C1 to recalculate DistA and DistB; if j = N, it indicates that the rotation axis geometry information does not exist a sketch line that matches it; Step C3: continue to make direction judgment according to the rotation axis direction vector, the start point coordinates and the end point coordinates of the sketch line, and determine whether the rotation axis geometric information exists a matching sketch line based on the direction judgment result.

[0036] Continuing to refer to Figure 6 As an embodiment of the present application, the direction judgment according to the rotation axis direction vector, the start point coordinates and the end point coordinates of the sketch line in step C3 specifically includes the following steps: Step C3-1: calculate the three-dimensional direction vector of the sketch line according to the start point coordinates and the end point coordinates of the sketch line, normalize it, and then take the absolute value to obtain LineDir; Step C3-2: take the absolute value of the rotation axis direction vector after normalization to obtain axisDir; Step C3-3: calculate the dot product of LineDir and axisDir to obtain dotB, if there exists dotB less than the square of the preset tolerance 0.000001, it indicates that the rotation axis geometric information exists a matching sketch line; the Lines (j) object is the corresponding sketch line; if dotB is greater than or equal to the square of the tolerance 0.000001, further judge whether j is less than N: if j is less than N, let j = j + 1, jump to step C1, and recalculate DistA and DistB; if j = N, it indicates that the rotation axis geometric information does not exist a matching sketch line.

[0037] In summary, the rotation axis type identification method of the NX rotation feature provided in the embodiment is based on traversing the parent feature of the rotation feature by using the NX secondary development interface, identifies the rotation axis type according to the parent feature combination type, and combines the topology element matching method, so that the rotation axis feature information can be accurately obtained in the identification process, thereby realizing the rotation axis type identification of the NX rotation feature, and meeting the demand of obtaining the topology relationship of the NX rotation feature part. As an embodiment of the present application, the present application further provides an electronic terminal, including a processor and a memory connected with the processor, and the memory stores a computer program, when the computer program is executed by the processor, the steps of the method of any one of the preceding embodiments are executed.

[0038] As an embodiment of the present application, the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the method of any one of the preceding embodiments.

[0039] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a software embodiment, the methods can be tangibly embodied in a machine-readable storage medium having stored thereon instructions that can be used to program a computer to perform any of the methods. The software implementation can be initialized by loading and executing a set of instructions arranged to perform one of the methods into the computer's memory. Alternatively, hard-wired circuitry can be used in place of, or in combination with, software instructions. Thus, the

[0040] The present application is described in reference to the drawings, which are as follows: Figure 1 Each flow and / or block in the flow and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow and / or block diagrams block or blocks. These computer program instructions can also be stored in a computer readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable storage medium produce an article of manufacture including instructions which implement the function specified in the flow and / or block diagrams block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks.

[0041] These computer program instructions can also be stored in a computer readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable storage medium produce an article of manufacture including instructions which implement the function specified in the flow and / or block diagrams block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks. The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks.

[0042] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks. The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow and / or block diagrams block or blocks.

[0043] The above description is only preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, without departing from the technical principles of the present application, a number of improvements and modifications can be made, and these improvements and modifications should be considered as the protection scope of the present application.

Claims

1. A method for identifying the rotation axis type of an NX rotation feature, characterized in that, The method includes the following steps: Obtain the NX rotational feature and its rotation axis geometry information; The parent features of the NX rotation feature are obtained by traversing through the NX secondary development interface. Classify the parent features based on the features contained in the parent features; Based on the rotation axis geometry information and combined with the topology element matching method, rotation axis type identification is performed for different parent feature combination types to obtain the rotation axis type identification result of the NX rotation feature; The rotation axis geometry information includes the rotation axis direction vector and the three-dimensional origin coordinates of the rotation axis; the features included in the parent feature include the reference axis feature and / or the base feature.

2. The method according to claim 1, characterized in that, Before using the NX secondary development interface to traverse and obtain the parent feature of the NX rotation feature, a parent feature container is established and initialized based on the linked storage structure and the NX secondary development interface to store the parent feature object information of the parent feature.

3. The method according to claim 1, characterized in that, The step of classifying parent features based on the features contained in the parent features includes: If the parent feature contains both the matrix feature and the reference axis feature, it is determined to be parent feature combination type one; if the parent feature contains the matrix feature but does not contain the reference axis feature, it is determined to be parent feature combination type two. If the parent feature does not contain the matrix feature but contains the reference axis feature, then it is determined to be parent feature combination type three; If the parent feature does not contain either the matrix feature or the reference axis feature, then it is determined to be parent feature combination type four.

4. The method according to claim 3, characterized in that, The step of identifying the rotation axis type based on the rotation axis geometry information and a topological element matching method for different parent feature combination types to obtain the rotation axis type identification result of the NX rotation feature includes: For parent feature combination type one, the rotation axis geometry information is matched with all entity edges of the base feature: if the rotation axis geometry information has a matching entity edge, the rotation axis type is identified as a reference entity edge type; otherwise, the rotation axis type is identified as a reference base axis type. For parent feature combination type two, the rotation axis geometry information is matched with all entity edges of the base feature: if the rotation axis geometry information has a matching entity edge, the rotation axis type is identified as a reference entity edge type; otherwise, the rotation axis geometry information is matched with sketch lines in all sketch parent features: if the rotation axis geometry information has a matching sketch line, the rotation axis type is identified as a reference sketch line type; otherwise, the rotation axis type is identified as a given reference direction and position type. For parent feature combination type three, the rotation axis type is directly identified as the reference axis type; For parent feature combination type four, the rotation axis geometry information is matched with sketch lines in all sketch parent features: if there is a matching sketch line for the rotation axis geometry information, the rotation axis type is identified as a reference sketch line type; otherwise, the rotation axis type is identified as a given reference direction and position type.

5. The method according to claim 4, characterized in that, The step of matching the rotation axis geometry information with all solid edges of the base feature includes: Based on the three-dimensional origin coordinates of the rotation axis in the rotation axis geometry information, the minimum distance from the three-dimensional origin coordinates of the rotation axis to each entity edge is calculated using the NX function UF_MODL_ask_minimum_dist; wherein, the entity edges are stored in a topology edge storage container, and the topology edge storage container uses the NX secondary development interface to obtain and store all entity edges of the base feature; If the minimum distance from the three-dimensional origin coordinates of the rotation axis to the current entity edge is less than the preset tolerance, it indicates that the three-dimensional origin of the rotation axis is on the current entity edge. Continue to make a direction judgment based on the rotation axis direction vector and the start and end points of the current entity edge. Based on the direction judgment result, determine whether there is a matching entity edge for the rotation axis geometric information. If the minimum distance from the three-dimensional origin coordinates of the rotation axis to all entity edges is greater than or equal to the preset tolerance, it indicates that the three-dimensional origin of the rotation axis is not on any entity edge in the topology edge storage container, and the rotation axis geometry information does not have a matching entity edge.

6. The method according to claim 5, characterized in that, The direction determination based on the rotation axis direction vector and the start and end points of the current entity edge includes: The absolute value of the rotation axis direction vector in the rotation axis geometry information is obtained by normalizing the rotation axis direction vector and taking its value. The three-dimensional direction vector of the current entity edge is calculated based on the start and end points, normalized, and then its absolute value is taken to obtain EdgeDir; The dot product of axisDir and EdgeDir is calculated to obtain dotA. If dotA is less than the square of the preset tolerance, it indicates that the rotation axis geometry information matches the current solid edge, and the rotation axis geometry information has a matching solid edge. If all the calculated dotA values ​​of all the entity edges in the topology edge storage container are greater than or equal to the square of the preset tolerance, it indicates that there is no matching entity edge for the rotation axis geometry information.

7. The method according to claim 4, characterized in that, The step of matching the rotation axis geometry information with sketch lines in all sketch parent features includes: Calculate the squared distance DistA between the three-dimensional origin coordinates of the rotation axis and the starting coordinates of each sketch line in the sketch line storage container, and the squared distance DistB between the starting coordinates and the ending coordinates of each sketch line; wherein, the sketch line storage container uses the NX secondary development interface to obtain and store all sketch lines in the current sketch. If either DistA or DistB is less than the square of the preset tolerance, the direction is determined based on the rotation axis direction vector, the start coordinates and the end coordinates of the sketch line, and the direction determination result determines whether there is a matching sketch line for the rotation axis geometry. If all DistA and all DistB are greater than or equal to the square of the preset tolerance, it indicates that there is no matching sketch line for the geometry of the rotation axis.

8. The method according to claim 7, characterized in that, The direction determination based on the rotation axis direction vector and the starting and ending coordinates of the sketch line includes: The absolute value of the rotation axis direction vector is obtained by normalizing it; Calculate the three-dimensional direction vector of the sketch line based on the starting and ending coordinates of the sketch line, normalize it, and then take the absolute value to obtain LineDir; The dot product of LineDir and axisDir is calculated to obtain dotB. If there is a dotB that is less than the square of the preset tolerance, it indicates that there is a matching sketch line in the geometry of the rotation axis. If all the calculated dotB values ​​for all the sketch lines in the sketch line storage container are greater than or equal to the square of the preset tolerance, it indicates that there is no matching sketch line for the rotation axis geometry information.

9. An electronic terminal, characterized in that, The method includes a processor and a memory connected to the processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the method as described in any one of claims 1 to 8 are performed.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 8.