STP data loading and track extraction method and system and readable storage medium
Through the OCCT library, CAD model data in STP format is directly processed and geometric and topological data are associated in Unity, which solves the structural differences and data loss problems of STP data extracted in Unity, and realizes the accurate trajectory extraction of STP data in Unity. Improve data processing and visualization efficiency.
Patent Information
- Application Number
- CN202411730348.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has problems with data conversion loss and structural differences when processing CAD model data in STP format, and lacks methods to directly read STP files and accurately extract trajectories, especially in Unity.
By directly processing CAD model data in STP format using the OCCT library, encapsulate it into a dynamic library and link it into Unity. Use ray detection to detect the associated geometric data and topological data, generate corresponding data structures and extract trajectories, and support static and dynamic extraction methods, including arcs , ellipse, hyperbolic surface, parabola, Bezier curve and B-spline curve extraction.
It avoids information loss during data conversion, realizes accurate trajectory extraction of STP data in Unity, improves data processing and visualization efficiency, reduces the complexity of data transmission and conversion, and has broad application prospects.
Smart Images

Figure CN119206139A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial manufacturing technology, and in particular to a STP data loading and trajectory extraction method, system and readable storage medium. Background Art
[0002] In the field of industrial manufacturing, the realization of digital twins and virtual-reality linkage has extremely high requirements for data accuracy. However, the existing technology has the following main shortcomings when processing CAD model data in STP format: Data conversion loss: The traditional method requires converting STP format data into other formats, such as STL (STereoLithography), FBX (FilmBox, 3D general model file), etc., before it can be used in Unity. Some data information may be lost during this conversion process.
[0003] Differences between geometry and topology: The data in Unity is based on geometry, while the data in CAD is based on topology. This structural difference leads to differences between the trajectories extracted in Unity and those extracted in CAD.
[0004] Lack of direct method to read STP files: Currently there is no feasible method on the market to directly read STP files in Unity and accurately extract trajectories. Summary of the invention
[0005] The purpose of this application is to provide a method, system and readable storage medium for loading and extracting STP data. By using the OCCT library (open source 3D geometry library), CAD model data in STP format can be directly processed to avoid information loss that may occur during data conversion. In the commercial engine Unity, geometric data and topological data can be associated through ray detection, so as to accurately extract the selected trajectory.
[0006] The first aspect of the present application provides a method for STP data loading and trajectory extraction, the method comprising: Read the STP data in the open source 3D geometry library (OCCT), build data relationships, and obtain geometric data and topological data; The STP data interface is encapsulated and linked into the commercial engine Unity in the form of a dynamic library; the commercial engine Unity associates the geometric data and topological data of the STP data through ray detection; Use the Brep manager to generate the corresponding data structure to receive the topological data; pass the geometric data to the mesh object and render the trajectory extraction model; Get the current mouse position and selected object through ray detection, and map the selected object to the corresponding track type in the boundary manager (Brep manager); The trajectory extraction model is used to extract the STP data trajectory according to the trajectory type and draw the STP data trajectory.
[0007] Optionally, reading the STP data through OCCT and building the data relationship includes: Use the OCCT internal data structure topology shape (TopoDS_Shape) to get all the geometric shape types of the current STP data; Create a selection manager to store STP data into different data tables according to the geometric shape type of STP data, generate index relationships, obtain topological data, and then store the topological data and geometric data; The STP data is discretized to generate a triangular network, and then an index relationship is generated and stored based on the triangular network.
[0008] Optionally, the trajectory type includes at least one of the following: an arc, an ellipse, a hyperbola, a parabola, a Bezier curve, and a B-spline curve.
[0009] Optionally, the extraction of STP data traces is divided into two methods: static extraction method and dynamic extraction method; During dynamic extraction, the STP data is highlighted when it passes over the corresponding object, and the object corresponding to the highlight is obtained, which is the STP data track; During static extraction, the object is statically selected, and the selected object is used to participate in drawing the STP data trajectory, thereby obtaining the STP data trajectory.
[0010] Optionally, drawing the STP data trajectory includes: extracting the trajectory, constructing different trajectories by curve types, and drawing the STP data trajectory by calculating the trajectory length and interpolating the nearest neighbor on the curve.
[0011] Optionally, calculate the length of the ellipse path, obtained by calculating the circumference of the ellipse using Ramanujan's formula: , in: , in, represents the length of the major semi-axis of the ellipse, represents the length of the minor semiaxis of the ellipse, and , is the relative difference between the major axis and the minor axis.
[0012] Optionally, when plotting hyperbolic and parabolic STP data traces, the length of the hyperbolic trace is determined by calculating the hyperbolic arc length, and the length of the parabolic trace is determined by calculating the parabola arc length: The formula for the length of a hyperbola is as follows: , The formula for the arc length of a parabola is as follows: , in, is the length of the hyperbolic arc, is the arc length of the parabola, is the parabola independent variable, is the horizontal coordinate of the starting point, is the horizontal coordinate of the end point, is the starting angle of the hyperbolic integration, is the end angle of the hyperbolic integral; Both hyperbolas and parabolas use Simpson's rule to approximate the integral and interpolate: , in, is the central angle of the circle, represents the length of the major semi-axis of the hyperbola, represents the length of the minor semi-axis of the hyperbola, is the width of each subinterval, ,... , ... is the point that divides the subinterval, is the number of subintervals.
[0013] Optionally, when drawing a B-spline STP data trajectory, B-spline curves are evaluated using the deBoor approximation: , in, is the basis function, For the control point.
[0014] A second aspect of the present application provides an STP data loading and trajectory extraction system, comprising a memory and a processor, wherein the memory comprises an STP data loading and trajectory extraction method program, and when the STP data loading and trajectory extraction method program is executed by the processor, the steps of an STP data loading and trajectory extraction method are implemented.
[0015] The third aspect of the present application provides a computer-readable storage medium, which includes an STP data loading and trajectory extraction method program. When the STP data loading and trajectory extraction method program is executed by a processor, it implements the steps of one of the STP data loading and trajectory extraction methods.
[0016] As can be seen from the above, the present application provides a method, system and readable storage medium for loading and extracting STP data. By using the OCCT library, the present application can directly process CAD model data in STP format, avoiding possible information loss during data conversion. The present application can associate geometric data and topological data in Unity through ray detection, so as to accurately extract the selected trajectory, such as points, line segments, curves, etc. Improved efficiency of data processing and visualization: The present application also integrates data processing and visualization, reduces the complexity of data transmission and conversion, and improves the overall efficiency of the system. Has broad application prospects: The method described in the present application can not only be applied to the field of industrial manufacturing, but also can be widely used in other fields that require CAD model data processing and visualization, such as mechanical design, architectural design, etc.
[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 An overall flow chart of an STP data loading and trajectory extraction method provided in an embodiment of the present application.
[0020] Figure 2 A flowchart of an STP data loading and trajectory extraction method provided in an embodiment of the present application.
[0021] Figure 3 This is a relationship diagram of the types of shapes in the OCCT provided in the embodiment of the present application.
[0022] Figure 4 A Brep manager type diagram provided for an embodiment of the present application.
[0023] Figure 5 A block diagram of an STP data loading and trajectory extraction system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0025] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0026] Please refer to Figure 1 , is a method for STP data loading and trajectory extraction in some embodiments of the present application, the method comprising: S102: Read the STP data in the open source 3D geometry library, build data relationships, and obtain geometry data and topology data; S104: Encapsulate the STP data interface in the form of a dynamic library and link it into the business engine Unity; use the business engine Unity to associate the geometric data and topological data of the STP data through ray detection; S106: using the Brep manager to generate a corresponding data structure to receive the topological data; passing the geometric data to the mesh object (mesh object), and rendering the trajectory extraction model; S108: obtaining the current mouse position and the selected object through ray detection, and mapping the selected object to the corresponding track type in the boundary manager (Brep manager); S110: Extracting the STP data trajectory according to the trajectory type using the trajectory extraction model and drawing the STP data trajectory.
[0027] It should be noted that OCCT, or Open CASCADE Technology, is an object-oriented C++ class library designed to quickly generate complex domain-specific CAD / CAM / CAE applications.
[0028] STP files are 3D graphics files of CAD drawing software, with the extension .stp. This file format is mainly used to store data of three-dimensional objects and support the exchange of product model data. STP files are based on the ASCII format and comply with the STEP (Standard for the Exchange of Product model data) application protocol ISO 10303-21 standard. This file format is widely used to exchange three-dimensional image data between different CAD software.
[0029] Unity is a real-time 3D interactive content creation and operation platform. All creators, including game development, art, architecture, automotive design, film and television, use Unity to turn their ideas into reality. The Unity platform provides a complete set of software solutions that can be used to create, operate and monetize any real-time interactive 2D and 3D content, supporting platforms including mobile phones, tablets, PCs, game consoles, augmented reality and virtual reality devices.
[0030] It should be noted that if Figure 2 As shown, the method described in this application mainly includes the steps of data relationship construction, data access, data mapping, and trajectory extraction.
[0031] Data relationship construction mainly includes step S102, data access mainly includes step S104 and step S106, data mapping mainly includes step S108, and trajectory extraction mainly includes step S110.
[0032] According to an embodiment of the present invention, the step of reading STP data in an open source 3D geometry library and constructing a data relationship includes: Use the OCCT internal data structure TopoDS_Shape to get all the geometric shape types of the current STP data; Create a selection manager to store STP data into different data tables according to the geometric shape type of STP data, generate index relationships, obtain topological data, and then store the topological data and geometric data; The STP data is discretized to generate a triangular network, and then an index relationship is generated and stored based on the triangular network.
[0033] It should be noted that this application uses OCCT to read STP data and build data relationships. Use the internal data structure TopoDS_Shape to get all the shape types of the current STP, create a selection manager based on type classification, such as Figure 3 Store in different data tables. Discretize STP to generate a triangular network, and then store all triangle relationships and index relationships.
[0034] According to an embodiment of the present invention, the trajectory types include: arc, ellipse, hyperbola, parabola, Bezier curve, and B-spline curve.
[0035] It should be noted that this application encapsulates the interface into Unity in the form of a dynamic library, and then creates a Brep manager such as Figure 4 Generate the corresponding data structure to receive the topological data. Pass the geometric data to the mesh object and render the model.
[0036] Then the current mouse position and selected object are obtained through ray detection. According to the selected object, it is mapped to the corresponding trajectory type in Brep manager. The types include arc, ellipse, hyperbola, parabola, Bezier curve, B-spline curve, etc.
[0037] It should be noted that B-spline curve refers to a special representation in numerical analysis, a sub-discipline of mathematics. It is a linear combination of B-spline basis curves. It was created by Isaac Jacob Schoenberg.
[0038] According to an embodiment of the present invention, the method of extracting the STP data track is divided into two methods: a static extraction method and a dynamic extraction method; During dynamic extraction, the STP data is highlighted when it passes over the corresponding object, and the object corresponding to the highlight is obtained, which is the STP data track; During static extraction, the object is statically selected, and the selected object is used to participate in drawing the STP data trajectory, thereby obtaining the STP data trajectory.
[0039] Optionally, drawing the STP data trajectory includes: extracting the trajectory, constructing different trajectories by curve types, and drawing the STP data trajectory by calculating the trajectory length and interpolating the nearest neighbor on the curve.
[0040] It should be noted that the extraction of STP data tracks in this application is divided into static extraction and dynamic extraction. Dynamic extraction will highlight the data when it passes over the corresponding object to prompt that the corresponding object has been selected. Static extraction makes the object corresponding to the STP data static and selected, and then participates in the subsequent processing process, including STP data track drawing.
[0041] According to an embodiment of the present invention, the length of the ellipse trajectory is calculated by calculating the circumference of the ellipse, and the circumference of the ellipse uses the Ramanujan formula: , in: , in, represents the length of the major semi-axis of the ellipse, represents the length of the minor semiaxis of the ellipse, and , is the relative difference between the major axis and the minor axis.
[0042] Optionally, when plotting hyperbolic and parabolic STP data traces, the length of the hyperbolic trace is determined by calculating the hyperbolic arc length, and the length of the parabolic trace is determined by calculating the parabola arc length: The formula for the length of a hyperbola is as follows: , The formula for the arc length of a parabola is as follows: , in, is the length of the hyperbolic arc, is the arc length of the parabola, is the parabola independent variable, is the horizontal coordinate of the starting point, is the horizontal coordinate of the end point, is the starting angle of the hyperbolic integration, is the end angle of the hyperbolic integral; Both hyperbolas and parabolas use Simpson's rule to approximate integrals and interpolate: , in, is the central angle of the circle, represents the length of the major semi-axis of the hyperbola, represents the length of the minor semi-axis of the hyperbola, is the width of each subinterval, ,... , ... is the point that divides the subinterval, is the number of subintervals.
[0043] According to an embodiment of the present invention, when drawing a B-spline curve STP data trajectory, B-spline curves are evaluated using the deBoor approximation: , in, is the basis function, is the control point, is the B-spline curve approximation, are the B-spline curve parameters, are the indices of basis functions and control points, is the order of the basis function.
[0044] The second aspect of the present application provides an STP data loading and trajectory extraction system, wherein the STP data loading and trajectory extraction system 5 comprises a memory 51 and a processor 52, wherein the memory 51 comprises an STP data loading and trajectory extraction method program, and when the STP data loading and trajectory extraction method program is executed by the processor 52, the following method steps are implemented: S102: Read the STP data in the open source 3D geometry library, build data relationships, and obtain geometry data and topology data; S104: Encapsulate the STP data interface into Unity in the form of a dynamic library; Unity associates the geometric data and topological data of the STP data through ray detection; S106: Generate a corresponding data structure using the Brep manager to receive topological data; pass the geometric data to the mesh object, and render the trajectory extraction model; S108: obtaining the current mouse position and the selected object through ray detection, and mapping the selected object to the corresponding track type in the Brep manager; S110: Extracting the STP data trajectory according to the trajectory type using the trajectory extraction model and drawing the STP data trajectory.
[0045] It should be noted that OCCT, or Open CASCADE Technology, is an object-oriented C++ class library designed to quickly generate complex domain-specific CAD / CAM / CAE applications.
[0046] STP (standard for the exchange of product model data: Scalable modular data exchange standard) file is the format of 3D graphics files of CAD drawing software, with the extension .stp. This file format is mainly used to store data of three-dimensional objects and support the exchange of product model data. STP files are based on the ASCII format and comply with the STEP (Standard for the Exchange of Product model data) application protocol ISO 10303-21 standard. This file format is widely used to exchange three-dimensional image data between different CAD software.
[0047] Unity is a real-time 3D interactive content creation and operation platform. All creators, including game development, art, architecture, automotive design, film and television, use Unity to turn their ideas into reality. The Unity platform provides a complete set of software solutions that can be used to create, operate and monetize any real-time interactive 2D and 3D content, supporting platforms including mobile phones, tablets, PCs, game consoles, augmented reality and virtual reality devices.
[0048] It should be noted that the method described in this application mainly includes the steps of data relationship construction, data access, data mapping, and trajectory extraction.
[0049] Data relationship construction mainly includes step S102, data access mainly includes step S104 and step S106, data mapping mainly includes step S108, and trajectory extraction mainly includes step S110.
[0050] According to an embodiment of the present invention, the step of reading STP data in an open source 3D geometry library and constructing a data relationship includes: Use the OCCT internal data structure TopoDS_Shape to get all the geometric shape types of the current STP data; Create a selection manager to store STP data into different data tables according to the geometric shape type of STP data, generate index relationships, obtain topological data, and then store the topological data and geometric data; The STP data is discretized to generate a triangular network, and then an index relationship is generated and stored based on the triangular network.
[0051] It should be noted that this application uses OCCT to read STP data and build data relationships. The internal data structure TopoDS_Shape is used to obtain all shape types of the current STP, and a selection manager is created to store them in different data tables according to type classification. The STP is discretized to generate a triangular network, and then all triangular relationships and index relationships are stored.
[0052] According to an embodiment of the present invention, the trajectory types include: arc, ellipse, hyperbola, parabola, Bezier curve, and B-spline curve.
[0053] It should be noted that this application encapsulates the interface into Unity in the form of a dynamic library, and then creates a Brep manager to generate the corresponding data structure to receive the topological data. The geometric data is passed to the mesh object to render the model.
[0054] Then the current mouse position and selected object are obtained through ray detection. According to the selected object, it is mapped to the corresponding trajectory type in Brep manager. The types include arc, ellipse, hyperbola, parabola, Bezier curve, B-spline curve, etc.
[0055] According to an embodiment of the present invention, the method of extracting the STP data track is divided into two methods: a static extraction method and a dynamic extraction method; During dynamic extraction, the STP data will be highlighted when passing over the corresponding object; Allow objects to be selected during static extraction and participate in drawing STP data tracks.
[0056] Optionally, drawing the STP data trajectory includes: extracting the trajectory, constructing different trajectories by curve types, and drawing the STP data trajectory by calculating the trajectory length and interpolating the nearest neighbor on the curve.
[0057] It should be noted that the extraction of STP data tracks in this application is divided into static extraction and dynamic extraction. Dynamic extraction will highlight the data when it passes over the corresponding object to prompt that the corresponding object has been selected. Static extraction makes the object corresponding to the STP data static and selected, and then participates in the subsequent processing process, including STP data track drawing.
[0058] According to an embodiment of the present invention, the length of the ellipse trajectory is calculated by calculating the circumference of the ellipse, and the circumference of the ellipse uses the Ramanujan formula: , in: , in, represents the length of the major semi-axis of the ellipse, represents the length of the minor semiaxis of the ellipse, and , is the relative difference between the major axis and the minor axis.
[0059] Optionally, when plotting hyperbolic and parabolic STP data traces, the length of the hyperbolic trace is determined by calculating the hyperbolic arc length, and the length of the parabolic trace is determined by calculating the parabola arc length: The formula for the length of a hyperbola is as follows: , The formula for the arc length of a parabola is as follows: , in, is the length of the hyperbolic arc, is the arc length of the parabola, is the parabola independent variable, is the horizontal coordinate of the starting point, is the horizontal coordinate of the end point, is the starting angle of the hyperbolic integration, is the end angle of the hyperbolic integral; Both hyperbolas and parabolas use Simpson's rule to approximate integrals and interpolate: , in, is the central angle of the circle, represents the length of the major semi-axis of the hyperbola, represents the length of the minor semi-axis of the hyperbola, is the width of each subinterval, ,... , ... is the point that divides the subinterval, is the number of subintervals.
[0060] According to an embodiment of the present invention, when drawing a B-spline curve STP data trajectory, B-spline curves are evaluated using the deBoor approximation: , in, is the basis function, is the control point, is the B-spline curve approximation, are the B-spline curve parameters, are the indices of basis functions and control points, is the order of the basis function.
[0061] The third aspect of the present application provides a computer-readable storage medium, which includes an STP data loading and trajectory extraction method program. When the STP data loading and trajectory extraction method program is executed by a processor, it implements the steps of one of the STP data loading and trajectory extraction methods.
[0062] As can be seen from the above, the present application provides a method, system and readable storage medium for loading and extracting STP data. By using the OCCT library, the present application can directly process CAD model data in STP format, avoiding possible information loss during data conversion. The present application can associate geometric data and topological data in Unity through ray detection, so as to accurately extract the selected trajectory, such as points, line segments, curves, etc. Improved efficiency of data processing and visualization: The present application also integrates data processing and visualization, reduces the complexity of data transmission and conversion, and improves the overall efficiency of the system. Has broad application prospects: The method described in the present application can not only be applied to the field of industrial manufacturing, but also can be widely used in other fields that require CAD model data processing and visualization, such as mechanical design, architectural design, etc.
[0063] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0064] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0065] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0066] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0067] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A STP data loading and trajectory extraction method, characterized in that: The method comprises: Read STP data in the open source 3D geometry library, build data relationships, and obtain geometry data and topology data; Encapsulate the STP data interface into a dynamic library and link it into the business engine; use the business engine to associate the geometric data and topological data of the STP data through ray detection; The boundary manager is used to generate a corresponding data structure to receive the topological data; the geometric data corresponding to the topological data is passed to the mesh object, and the trajectory extraction model is rendered; Get the current mouse position and selected object through ray detection, and map the selected object to the corresponding track type in the boundary manager; The trajectory extraction model is used to extract the STP data trajectory according to the trajectory type and draw the STP data trajectory.
2. A STP data loading and trajectory extraction method according to claim 1, characterized in that: The reading of STP data in the open source 3D geometry library and the construction of data relationships include: Use the topological structure of the internal data structure of the open source 3D geometry library to obtain all geometric shape types of the current STP data; Create a selection manager, store the STP data into different data tables according to the geometric shape type of the STP data, generate index relationships, obtain topological data, and then store the topological data and geometric data; The STP data is discretized to generate a triangular network, and then an index relationship is generated and stored based on the triangular network.
3. A STP data loading and trajectory extraction method according to claim 2, characterized in that: The trajectory type includes at least one of the following: an arc, an ellipse, a hyperbola, a parabola, a Bezier curve, and a B-spline curve.
4. A STP data loading and trajectory extraction method according to claim 3, characterized in that: The method of extracting STP data trajectory is divided into two methods: static extraction method and dynamic extraction method; During dynamic extraction, the STP data is highlighted when it passes over the corresponding object, and the object corresponding to the highlight is obtained, which is the STP data track; During static extraction, the object is statically selected, and the selected object is used to participate in drawing the STP data trajectory, thereby obtaining the STP data trajectory.
5. A STP data loading and trajectory extraction method according to claim 4, characterized in that: The drawing of the STP data trajectory comprises: extracting the trajectory, constructing different trajectories by curve types, and drawing the STP data trajectory by calculating the trajectory length and combining the nearest neighbor on the curve for interpolation.
6. A STP data loading and trajectory extraction method according to claim 5, characterized in that: Calculate the length of the ellipse trajectory, which is obtained by calculating the circumference of the ellipse. The circumference of the ellipse uses Ramanujan's formula: , in: , in, represents the length of the major semi-axis of the ellipse, represents the length of the minor semiaxis of the ellipse, and , is the relative difference between the major axis and the minor axis.
7. A STP data loading and trajectory extraction method according to claim 5, characterized in that: When plotting hyperbolic and parabolic STP data traces, the length of the hyperbolic trace is determined by calculating the hyperbolic arc length, and the length of the parabolic trace is determined by calculating the parabola arc length: The formula for the length of a hyperbola is as follows: , The formula for the arc length of a parabola is as follows: , in, is the length of the hyperbolic arc, is the arc length of the parabola, is the parabola independent variable, is the horizontal coordinate of the starting point, is the horizontal coordinate of the end point, is the starting angle of the hyperbolic integration, is the end angle of the hyperbolic integral; Both hyperbolas and parabolas use Simpson's rule to approximate the integral and interpolate: , in, is the central angle of the circle, represents the length of the major semi-axis of the hyperbola, represents the length of the minor semi-axis of the hyperbola, is the width of each subinterval, ,... , ... is the point that divides the subinterval, is the number of subintervals.
8. A STP data loading and trajectory extraction method according to claim 5, characterized in that: When drawing the B-spline STP data trajectory, B-spline curves are evaluated using the deBoor approximation: , in, is the basis function, is the control point, is the B-spline curve approximation, are the B-spline curve parameters, are the indices of basis functions and control,points, is the order of the basis function.
9. A STP data loading and trajectory extraction system, characterized in that: It comprises a memory and a processor, wherein the memory comprises an STP data loading and trajectory extraction method program, and when the STP data loading and trajectory extraction method program is executed by the processor, the steps of an STP data loading and trajectory extraction method as described in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an STP data loading and trajectory extraction method program. When the STP data loading and trajectory extraction method program is executed by a processor, the steps of an STP data loading and trajectory extraction method as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Geometric model processing method and device, electronic equipment and storage medium
CN115828349A
Analysis and identification method for geometric topological features of three-dimensional model
CN117290290A
Cutter contact generation algorithm of complex curved surface three-dimensional model ultra-precision turning CAM software
CN117518992A
Database-based CAD file lightweight model generation system and method
CN117874849A
STEP-based shaft part feature recognition method and system
CN118886412A
