Method, device and equipment for creating three-dimensional model of electronic component and storage medium

Creating three-dimensional electronic components through domain-specific language (DSL) automation solves the problems of inefficiency, difficulty in maintenance and high cost in the existing technology, and realizes efficient, accurate and standardized model creation, enhancing the maintainability of the model and Cross-domain collaboration capability.

CN119026554APending Publication Date: 2024-11-26CHONGQING INST OF GREEN & INTELLIGENT TECH CHINESE ACAD OF SCI +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411110036.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing methods for creating three-dimensional models of electronic components, including manual modeling and parameterized modeling, have problems such as inefficiency, difficulty in maintenance and update, high cost and limited design flexibility, especially in the design of complex electronic systems across fields. Very difficult.

Method used

Use domain-specific language (DSL) to create three-dimensional models of electronic components. By obtaining DSL source code, using lexical analyzers, grammatical analyzers and 3D interpreters, converting DSL source code into three-dimensional geometric models, realizing fully automated processes and reducing manpower Cost, improve modeling efficiency and standardization level, enhance model maintainability and cross-domain synergy capabilities.

Benefits of technology

It realizes efficient, precise and standardized creation of three-dimensional models of electronic components, reduces labor costs, improves model maintainability and design flexibility, simplifies cross-domain collaboration, reduces design misunderstandings and errors, and improves overall project collaboration efficiency .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026554A_ABST
    Figure CN119026554A_ABST
Patent Text Reader

Abstract

The invention provides an electronic component three-dimensional model creating method and device, equipment and a storage medium. Relates to the cross technical field of electronic design automation and computer aided design. The method comprises the following steps: acquiring a DSL source code for constructing a three-dimensional model of the electronic component; converting the DSL source code into a plurality of marks by using a DSL lexical analyzer to obtain a mark sequence formed by the plurality of marks; analyzing the tag sequence into an abstract syntax tree by using a DSL syntax analyzer; and converting the abstract syntax tree into a three-dimensional geometric model of the electronic component by utilizing a 3D interpreter. According to the method, the electronic component three-dimensional model is automatically created by using the specific field language, so that the modeling efficiency, accuracy and standardization level are improved, the labor cost is reduced, the maintainability and updatability of the model are enhanced, and meanwhile, higher design flexibility and cross-field cooperation capability are provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the interdisciplinary technical field of electronic design automation and computer-aided design, and in particular to a method, device, equipment and storage medium for creating a three-dimensional model of an electronic component. Background Art

[0002] In the field of EDA design, in the circuit design of modern smart products, the three-dimensional model of electronic components is a very important element in addition to symbols and packages. The main reasons are as follows:

[0003] Space planning and layout: 3D models can accurately reflect the real size and shape of electronic components, helping engineers to make reasonable space planning when designing circuit boards (PCBs). This ensures that all components can be installed correctly and avoid mutual interference.

[0004] Mechanical compatibility: 3D models allow designers to compare circuit boards with housings or other mechanical components to ensure they are physically compatible and avoid interference. This is important for reducing assembly errors, improving production efficiency, and reducing manufacturing costs.

[0005] Electromagnetic compatibility (EMC): The physical layout of components directly affects the electromagnetic characteristics of the circuit. Through 3D models, designers can better predict and solve potential electromagnetic interference problems and improve the electromagnetic compatibility of circuits.

[0006] Visualization and collaboration: The 3D model provides intuitive visualization effects, making communication between different teams (such as hardware design, mechanical design, and manufacturing teams) smoother, reducing misunderstandings and errors, and improving the overall project collaboration efficiency.

[0007] Virtual prototyping and simulation: Using 3D models, you can create virtual prototypes to conduct various simulation tests (such as mechanical stress testing, thermal management testing, etc.), discover and solve problems in advance, and shorten the product development cycle.

[0008] In summary, the 3D models of electronic components play an indispensable role in the field of EDA design, helping engineers achieve more efficient, reliable and sophisticated designs. However, the current 3D models of electronic components are obtained by manual creation or parametric modeling, which is time-consuming and laborious.

[0009] As a computer-aided design (CAD) method, parametric modeling provides many advantages, such as efficiency, flexibility, and reusability, but it requires users to predict and define feature constraints, history trees, and dependencies to ensure that any design changes will be updated in a predefined manner. Therefore, there are some limitations and challenges. The following are some of the main limitations of parametric modeling methods:

[0010] High skill requirements: Parametric modeling usually requires designers to have advanced CAD software skills and in-depth understanding, because the creation and modification of parametric models involves complex feature constraints, parameter settings, etc.

[0011] Model complexity issues: For very complex models, parametric modeling may result in a large set of parameters and complex dependencies, which may affect software performance and increase the difficulty of model maintenance.

[0012] History tree problem: Parametric modeling usually relies on the history tree of the model (that is, the sequence of modeling steps). If the history tree is too complex or incorrect, problems may occur when modifying the model, and even cause the model to crash.

[0013] Data complexity: Parametric modeling involves a lot of data management, including parameters, constraints, and associativity. As the scale of the project increases, it becomes more difficult to maintain data consistency, integrity, and modifiability.

[0014] Compatibility and portability: Different CAD systems may have different parametric modeling methods, which may cause problems when porting models between different software.

[0015] Initial setup time: Although parametric modeling saves time in long-term projects, the initial setup and commissioning of a parametric model can require significant time and effort.

[0016] Based on the above considerations, it can be seen that parametric modeling is not very suitable for the task of creating 3D models of electronic components. Parametric modeling methods have certain limitations and are semi-automatic.

[0017] Artificial intelligence (AI) is becoming more and more mature in image processing, autonomous driving, AIGC (AI-Generated Content), and natural language processing, and its applications are becoming more and more widespread. AI is also emerging in creating 3D models for multimedia fields such as games and movies (for details, please refer to the link), but it is currently not competent for the task of creating 3D models in the engineering field that requires precise dimensions. The main reasons are as follows:

[0018] Precision and detail: The engineering field often requires models with precise dimensions, and slight dimensional differences may affect the performance of the final product. AI-generated models may find it difficult to achieve this level of accuracy, and AI is currently mainly explored in creating artistic 3D models.

[0019] Specifications and standards: Engineering design usually needs to follow strict standards and specifications. Currently, the 3D models that AI can generate do not meet industry standards.

[0020] Lack of domain knowledge: Although AI can learn from large amounts of data, it lacks the domain knowledge of humans and is unable to create 3D models required in the engineering field.

[0021] Cost and efficiency: For 3D models that require extremely high accuracy, the AI-generated model process may not be as efficient or cost-effective as traditional modeling methods, especially considering factors such as additional quality control and consistency verification.

[0022] Domain-Specific Language (DSL) is a programming language specially designed for a specific field. It has the characteristics of strong targeting of professional application fields, concise code, and easy use by domain experts.

[0023] Existing technologies all use parametric modeling. For example:

[0024] Invention patent CN106021721B: A parametric simulation analysis method and CAE system for carburized cylindrical gears.

[0025] Invention patent CN107315876B: A parametric modeling production method for prefabricated beams.

[0026] Invention patent CN107609321B: Parametric modeling method of continuous beam bridge based on Revit platform.

[0027] Invention patent CN111063030B: A BIM parametric modeling method and device based on Dynamo.

[0028] The limitations of parametric modeling have been described in detail before and will not be repeated here. Please refer to the introduction in the previous background knowledge.

[0029] In terms of 3D models of electronic components, existing manual modeling and parametric modeling have at least one of the following defects:

[0030] Inefficiency: Manual modeling requires designers to spend a lot of time and effort to create and modify models, especially for complex electronic components. This process can be extremely time-consuming and error-prone. Even if parametric modeling can partially solve this problem, its initial setup, parameter setting and debugging still require considerable expertise and time investment.

[0031] Difficulty in maintenance and updating: With the upgrading of electronic components, the models also need to be updated accordingly. Both manual modeling and parametric modeling face challenges in this regard.

[0032] High cost: Whether it is manual modeling or parametric modeling, it requires a professional team of designers and advanced software tools, which undoubtedly increases the cost burden of the enterprise. In addition, the maintenance and update of 3D models also requires continuous capital investment.

[0033] Limited design flexibility: Although parametric modeling provides rule-based model generation, its flexibility is still limited when facing non-standard or customized requirements. Although manual modeling is more flexible, its efficiency and consistency are difficult to guarantee.

[0034] Difficulty in cross-domain collaboration: In the design of complex electronic systems, experts from multiple fields such as electrical engineers and mechanical engineers are required to work together. Manual modeling and parametric modeling methods may not provide an effective collaboration platform, resulting in inefficient communication and collaboration. Summary of the invention

[0035] The present application provides a method, apparatus, device and storage medium for creating a three-dimensional model of an electronic component, which is used to automatically create a three-dimensional model of an electronic component using a specific domain language, aiming to improve modeling efficiency, accuracy and standardization, reduce labor costs, enhance the maintainability and updatability of the model, and also provide higher design flexibility and cross-domain collaboration capabilities.

[0036] In a first aspect, the present application provides a method for creating a three-dimensional model of an electronic component, comprising:

[0037] Get the DSL source code for building 3D models of electronic components;

[0038] Using a DSL lexical analyzer, converting the DSL source code into a plurality of tokens to obtain a token sequence formed by the plurality of tokens;

[0039] Using a DSL parser, parsing the tag sequence into an abstract syntax tree;

[0040] The abstract syntax tree is converted into a three-dimensional geometric model of the electronic component using a 3D interpreter.

[0041] In one possible design, a DSL source code for building a 3D model of an electronic component is obtained, including:

[0042] Inputting a DSL source code for constructing a three-dimensional model of an electronic component based on a set DSL grammar rule, and / or automatically generating a DSL source code that complies with the set DSL grammar rule based on a data sheet of the electronic component;

[0043] The DSL grammar rules include the following semantic features:

[0044] Import and export: used to import the set body, pin, material and color elements from the DSL built-in standard library;

[0045] Package: used to define the electrical characteristics of the package of electronic components;

[0046] Body: used to define the main part geometry in the 3D model of electronic components;

[0047] Pin: used to define the pin part geometry in the 3D model of electronic components;

[0048] Materials and Colors: Keywords for materials that define the appearance of 3D models, and keywords for defining the color of geometry.

[0049] Module definition: Keywords for custom geometry modules;

[0050] Geometry primitives: Geometry primitive keywords used to create custom geometric figures.

[0051] In a possible design, a DSL lexical analyzer is used to convert the DSL source code into a plurality of tokens, and a token sequence formed by the plurality of tokens is obtained, including:

[0052] Setting various token types and regular expressions for identifying token types, wherein the token types include keywords, identifiers, numbers, operators, and strings;

[0053] Read the text in the DSL source file character by character to identify valid elements: ignore spaces and newline symbols in the DSL source file; if a set symbol is encountered, read to the end of the line and discard the characters that have been read; use regular expressions to match characters or character sequences to get a valid element; match character sequences consisting of letters, numbers, and underscores to get a valid element; match integers or floating-point numbers to get a valid element; identify set operators to get a valid element, and match character sequences surrounded by double quotes or single quotes to get a valid element;

[0054] Each time a valid element is identified, a tag is generated, wherein the tag includes tag type, tag value and tag position information;

[0055] If an unrecognizable character sequence is encountered, an error message is recorded and processing stops;

[0056] If the entire DSL source file is processed, a tag sequence formed by several tags is output.

[0057] In a possible design, a DSL syntax analyzer is used to parse the tag sequence into an abstract syntax tree, including:

[0058] Setting context-free grammar and grammar rules, wherein the grammar rules include main program, statement list, statement, import statement, export statement, package definition, body definition, pin definition, material definition, color definition, module definition, assignment statement, expression, term, factor;

[0059] Read the Token sequence;

[0060] Recursive descent parsing: define a parsing function for each grammar rule, and recursively descent parse from the main program according to the corresponding grammar rule until each statement list, statement, expression, term, and factor is parsed. At the same time, use a stack to manage nested structures, such as the nested brace pairs used in module definitions.

[0061] Generate an abstract syntax tree node: Use the import statement as the root node of the abstract syntax tree to represent the main program. According to the token sequence input later, if a certain syntax rule is matched, initialize and generate a new child node, set the node type, and return the child node after processing.

[0062] If there are tokens that do not match any grammatical rules, a grammatical error is determined and the error location and cause are recorded;

[0063] If all token sequences are processed and there are no syntax errors, the abstract syntax tree is output.

[0064] In a possible design, a 3D interpreter is used to convert the abstract syntax tree into a three-dimensional geometric model of an electronic component, including:

[0065] Get the abstract syntax tree;

[0066] Start processing from the root node of the abstract syntax tree, recursively traverse the entire tree structure, analyze the types of different nodes, and map the corresponding processing logic functions;

[0067] Processing nodes for constructing geometric bodies in the abstract syntax tree, reading geometric body shape and size information defined therein, creating corresponding geometric bodies for geometric primitive nodes; performing Boolean addition, Boolean subtraction, Boolean merging and / or stretching operations on geometric bodies for operator nodes; constructing the geometries of the main body and the pin part respectively according to the characteristics of the electronic component, and merging the pin part into the main body through array or geometric position transformation to complete the geometric construction of the three-dimensional model of the electronic component;

[0068] Process the nodes in the abstract syntax tree that define the colors of the body and pin part geometries, and apply material and color attributes to the specified geometries;

[0069] Convert geometry into a triangular mesh suitable for rendering and storage.

[0070] In one possible design, after converting the abstract syntax tree into a three-dimensional geometric model of an electronic component using a 3D interpreter, the method further includes:

[0071] The three-dimensional geometric model of the electronic component is written and stored in a specified 3D file to obtain the electronic component 3D file.

[0072] In a second aspect, the present application provides a device for creating a three-dimensional model of an electronic component, comprising:

[0073] A data acquisition module is configured to acquire DSL source code for constructing a three-dimensional model of an electronic component;

[0074] A lexical analysis module is configured to use a DSL lexical analyzer to convert the DSL source code into a plurality of tokens to obtain a token sequence formed by the plurality of tokens;

[0075] A syntax analysis module, configured to parse the tag sequence into an abstract syntax tree using a DSL syntax analyzer;

[0076] The model creation module is configured to convert the abstract syntax tree into a three-dimensional geometric model of the electronic component by using a 3D interpreter.

[0077] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method for creating a three-dimensional model of an electronic component as described in the first aspect and various possible designs of the first aspect.

[0078] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the method for creating a three-dimensional model of an electronic component as described in the first aspect and various possible designs of the first aspect is implemented.

[0079] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the method for creating a three-dimensional model of an electronic component as described in the first aspect and various possible designs of the first aspect.

[0080] The electronic component 3D model creation method, device, equipment and storage medium provided in this application realize a fully automated process for creating electronic component 3D models. Using DSL to create a 3D model of an electronic component does not require a relatively large 3D model file itself, which is conducive to remote collaboration and sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0082] Figure 1 A flowchart of a method for creating a three-dimensional model of an electronic component provided in an embodiment of the present application;

[0083] Figure 2 A schematic diagram of a set data structure for storing electronic component size data provided in an embodiment of the present application;

[0084] Figure 3 A DSL source code conversion flow chart provided in an embodiment of the present application;

[0085] Figure 4 Abstract syntax tree generation flow chart provided in the embodiment of the present application;

[0086] Figure 5 A flowchart for constructing a three-dimensional geometric model provided in an embodiment of the present application;

[0087] Figure 6 A schematic diagram of the structure of a device for creating a three-dimensional model of an electronic component provided in an embodiment of the present application;

[0088] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0089] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0090] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0091] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0092] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0093] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0094] Glossary:

[0095] Domain-Specific Language: A domain-specific language, often referred to as DSL, is a computer programming language designed specifically for a specific application domain. DSL provides an expression method that is closer to the terms and concepts used by domain experts, making code writing more intuitive, concise, and efficient when solving problems in the domain.

[0096] DSL Source Code: Source code refers to the original text of a computer program written using a text editor or IDE. DSL Source Code refers to a text file with a specific suffix (.e3d) and stored in UTF-8 encoding format, which is composed of a series of text instructions that conform to the grammatical rules of the specific domain language of the method of the present invention.

[0097] Token: In the parsing process of a programming language, a token is the smallest unit of meaning that a lexical analyzer recognizes from the source code. A token usually represents a specific grammatical element, such as a keyword, identifier, constant, operator, etc. Tokens are the output of the lexical analysis stage and are used for subsequent grammatical analysis.

[0098] Lexical Analyzer: Lexical Analyzer is responsible for breaking down the source code into a series of tokens.

[0099] Syntax Analyzer: The syntax analyzer receives the token sequence from the lexical analyzer and constructs the grammatical structure of the program according to the grammatical rules of a specific language. The main task of the syntax analyzer is to check whether the token sequence conforms to the grammatical rules of a specific language. If it does, it generates an intermediate representation, such as an abstract syntax tree, for subsequent semantic analysis and code generation.

[0100] Abstract Syntax Tree: Abstract Syntax Tree is often abbreviated as AST. It is a tree data structure used to represent the grammatical structure of source code. AST is usually the result generated by a syntax analyzer.

[0101] 3D Interpreter: In the present application method, the role of the 3D interpreter is to convert AST into a 3D model file of the electronic component. The file format of the 3D model is determined by the instructions in the DSL source code, which has higher flexibility and convenience.

[0102] An embodiment of the present application provides a method for creating a three-dimensional model of an electronic component. Figure 1 Flow chart of the method for creating a three-dimensional model of an electronic component provided in an embodiment of the present application. Figure 1 As shown, the electronic component three-dimensional model creation method can be implemented based on an electronic terminal, and the electronic component three-dimensional model creation method includes:

[0103] Step S10: Obtain DSL source code.

[0104] In this embodiment, in addition to manually inputting the DSL source code according to the DSL grammar rules provided in the embodiment of the present application, other foreseeable methods include: (1) automatically analyzing the electronic component data manual by an automated program to automatically generate a source file that complies with the DSL grammar rules provided in the embodiment of the present application; (2) using an AI large language model to analyze the electronic component data manual and automatically generate a source file that complies with the DSL grammar rules provided in the embodiment of the present application.

[0105] The DSL grammar rules and features provided by the embodiments of the present application are:

[0106] Import and export: Import and export statements are provided, including four keywords: from, import, as, and export. Not only can the required body, pins, materials, colors, and other elements be imported from the built-in standard library of this DSL, but also from custom modules. In addition to importing, custom body, pins, materials, colors, and other elements can also be exported.

[0107] Package: Provides the package keyword footprint to define the package electrical characteristics of electronic components, which helps in the adaptive 3D modeling of electronic components with the same package.

[0108] Body: The body keyword body is provided to define the main part geometry in the 3D model of electronic components.

[0109] Pins: The pin keyword pins is provided to define the pin part geometry in the 3D model of electronic components.

[0110] Materials and colors: Provides the material keyword material for defining the appearance of 3D models, and the keyword rgb for defining the color of geometric figures.

[0111] Module definition: The keyword def is provided for customizing geometric graphics modules, which facilitates the use of geometric primitives to create complex geometric graphics. The definition of any module is enclosed by a bunch of curly braces {…}.

[0112] Geometric primitives: A series of geometric primitive keywords for creating custom geometric figures are provided, such as the plane keyword for defining the sketch plane, point, line, polyline, circle, rectangle, polygon, text, etc. for creating two-dimensional figures, sphere, cube, cylinder, etc. for creating three-dimensional geometric figures, on, at keywords for auxiliary positioning, box keyword for calculating bounding boxes, and keywords for geometric figure operations such as extrude, sweep, Boolean addition, Boolean subtraction, Boolean intersection, array, subdivision, move, scale, rotate, etc. In order to facilitate the writing of geometric primitives for geometric feature generation, this DSL also provides equivalent operation symbols for some commonly used geometric primitives, such as the plus sign + is equivalent to the Boolean addition operation, the minus sign - is equivalent to the Boolean subtraction budget, the symbol ^ is equivalent to the Boolean union operation, and the symbol >> is equivalent to extrude, etc.

[0113] Assignment: The keyword equals is provided for variable assignment, and the equivalent symbol is the equal sign.

[0114] Save as 3D file: A save keyword is provided for outputting saved as a 3D file. Save is followed by the complete file name of the 3D file to be saved.

[0115] Comments: Comment keywords are provided. Characters starting with the # symbol and continuing to the end of the line are considered comments. Comments are for the convenience of people's understanding and communication and do not affect subsequent processing and the generation of the final 3D file.

[0116] In one embodiment, an automated program automatically analyzes the electronic component data sheet and automatically generates a source file that complies with the DSL grammar rules provided in the embodiment of the present application, including:

[0117] Based on the electronic component data manual, the electronic component size data is extracted and stored in a set data structure to obtain structured data. Based on the DSL grammar rules described above, a DSL source code that can generate the electronic component can be automatically generated according to the structured data.

[0118] Figure 2 The present invention is a schematic diagram of a set data structure for storing electronic component size data provided by an embodiment of the present invention. The set data structure includes multiple first-level elements, namely, body, pin, bounding box, tag and meta information. Each first-level element includes a second-level element. Based on the electronic component data manual, the electronic component size data is extracted and stored in the second-level element, and structured data is obtained. The structured data is conducive to automated operation. Among them, the second-level elements included in each first-level element and their explanations are as follows:

[0119] The second-level elements included in the first-level element body are:

[0120] Dimension data: If the image data is a vector graphic, the value of the dimension data is consistent with it, and the size of the vector graphic is based on the actual size value extracted from the data manual. Otherwise, the dimension text data obtained by OCR recognition in the scalar graphic in the data manual is stored, including the value, dimension line direction and text coordinates.

[0121] Graphics data: preferably, the vector graphics data after the main part is converted is stored. If the conversion fails, the scalar graphics in the mechanical view are intercepted and stored separately.

[0122] Material color (optional): If the data sheet contains colored electronic component images, locate and select the RGB color of the main part of the electronic component, otherwise assign a default main color according to the electronic component type or leave it blank. For example: the main body of the integrated chip is RGB (5,5,5), the main body of the chip resistor is RGB (25,25,25), the main body of the chip capacitor is RGB (245,135,25), the main body of the chip inductor is RGB (70,65,85), etc.

[0123] The secondary elements included in the primary element pin are:

[0124] Quantity: Number of pins, a positive integer.

[0125] Distribution matrix: The distribution coordinate matrix of the pins.

[0126] Dimension data: If the image data is a vector graphic, the value of the dimension data is consistent with it, and the size of the vector graphic is based on the actual size value extracted from the data manual. Otherwise, the dimension text data obtained by OCR recognition in the scalar graphic in the data manual is stored, including the value, dimension line direction and text coordinates.

[0127] Graphic data: preferably store the converted vector graphics data of a single pin portion. If the conversion fails, each scalar graphics in the mechanical view is intercepted and stored separately.

[0128] Material color (optional): If the data sheet contains colored images of electronic components, locate and select the RGB color of the electronic component pins. Otherwise, the default color of the pins is silver RGB (195,195,195). This value is optional and can be empty.

[0129] The second-level elements included in the first-level element bounding box are:

[0130] Dimensional data: length, width, and height of the bounding box.

[0131] First-level element tag (optional). If it does not exist in the data manual or the extraction fails, it can be empty. The second-level elements included are:

[0132] Coordinates / Size: The coordinates of the marker and the length and width of the area it occupies.

[0133] Text (optional): If the tag can be converted to text, the text content is stored directly, otherwise the graphic data of the tag is stored. This is empty.

[0134] Graphic data: It is preferred to store the converted vector graphics data of a single pin part. If the conversion fails, the scalar graphics of the marked area are stored.

[0135] The second-level elements included in the first-level element meta-information are:

[0136] Link information (optional): If the input data is a link address, the electronic component link information is stored. If the input data is a PDF format data sheet of the electronic component, the link information is empty.

[0137] Manufacturer model: The manufacturer model of the electronic component, extracted from the link information or the electronic component PDF format data sheet.

[0138] Package: The package information of the electronic component, extracted from the linked information or the electronic component PDF format data sheet.

[0139] It should be noted that the "optional" in the above brackets means that the corresponding element is not necessary and can be empty, and is filled in according to the actual component geometry data extraction situation.

[0140] Taking the PDF format data sheet of electronic components as an example, based on the electronic component data sheet, extracting the electronic component size data includes the following steps S1 to step 5, which are described in detail as follows:

[0141] Step S1: Obtain a PDF format data sheet of a target electronic component.

[0142] In step S1, if the input is a file, it is determined whether it is a PDF format document. If it is, it is necessary to extract the text and obtain the meta information data of the electronic component by keyword search. The PDF document is used as the final input file for the next step; otherwise, it returns failure and the method ends. If the input is a string, firstly, a regular expression is used to match whether it is a link address. If it is, the link address is accessed through the built-in search engine, the data sheet file link and the electronic component meta information data are extracted from the page, and the PDF format data sheet is cached and downloaded as the final input. If there is a preview image of the electronic component on the link page, the image data of the electronic component is cached at the same time for use in the subsequent processing steps; if the input string is other keywords, the "Datasheet" keyword is automatically added, and the access link address of the electronic component is found and extracted through the built-in search engine, and the previous processing steps of the input as the link address are repeated.

[0143] Step S2: Dimension view positioning.

[0144] In step S2, size feature matching is performed first. If three or more size features are successfully obtained, it indicates that the input electronic manual PDF format document contains a size view and the positioning is successful. Otherwise, text extraction is performed on the input PDF format document, and positioning is attempted by searching Chinese and English keywords, and the positioning result is returned for subsequent processing. For some special electronic components, the data manual may not contain a size view. If the positioning fails, it is necessary to extract the electronic component type and package metadata from the metadata of the electronic component, and then search and extract the results from the built-in database. As long as the positioning fails, the method of the present invention ends and directly returns the result data stored in the built-in database. The so-called built-in database is a database specially provided by the present method, which is obtained by pre-extraction and storage of size data of electronic components in standard packages, and incremental storage of size data of electronic components successfully processed by the present method, and is stored in a data structure of electronic component size data specially provided by the present method.

[0145] It should be noted that the dimension features include H-shaped dimension markings, symmetrical dimension arrows, dimension data / letters and other elements.

[0146] Step S3: size and style determination.

[0147] Since some electronic components share a data sheet in the form of a series, the dimension data in the dimension feature is provided in the form of letters and tables. Dimension style judgment is mainly used to process the data sheets of such electronic components. If the dimension data in the dimension feature is a letter, and there is a dimension table immediately following it, then after the dimension view data extraction in step S4 is completed, it is necessary to additionally perform chart character size matching, otherwise proceed directly to step S5 dimension data storage.

[0148] Step S4: Dimensional view data extraction.

[0149] In step S4, after successfully locating the size view position in step S2, the size view page data of the corresponding position in the data manual is obtained. Vector data extraction is attempted first. If the extraction fails, it indicates that the page view size graphic is a scalar graphic, and the scalar graphic needs to be converted into a vector graphic. After the vector graphic is obtained, it is determined whether the chart character size needs to be matched according to the size style judgment result of step S3, and then the size graphic is uniformly scaled according to the size data to obtain the full-scale size graphic data. Then the main body, pins and marks are identified, and it is determined whether there is a mark inside the main image area. If so, the graphic data and coordinate / size data of the mark are extracted; the graphics of the main body part are identified, and the size data and graphics of the main body part are extracted and associated; the graphics of the pin part are identified, and the number of pins is extracted. The distribution matrix of the center point connected to each pin and the main body part is used as the pin distribution matrix, and the size data and graphic data of a single pin are associated. Finally, the size data of the bounding box is calculated based on the size data and graphic data of the main body and pins.

[0150] The pin distribution matrix is ​​expressed as:

[0151]

[0152] where x i ,y i ,z i ,θ i They respectively refer to the coordinates of the center point of the cross section where the pin contacts the main body and the rotation angle of the pin when the i-th pin takes the center of the component body as the coordinate origin, where i∈[1,n] is a positive integer and n represents the number of pins. The number of rows in this 4×n matrix represents the number of pins of the electronic component. When defining the XYZ coordinate axis, the top view in the dimension view that can most completely display all the pins is usually used as the XY plane view. It is usually the top view in the dimension view with the largest area occupied by the dimension elements. After defining the XY plane, select the view corresponding to the main view in the dimension view, and use its lowest point as the origin of the Z coordinate.

[0153] Step S5: Dimensional data storage. Before the dimension data is stored, if the appearance image data of the electronic component is successfully cached in step S1, or the appearance image data exists in the data manual document, the material color data of the main body and the pin part are obtained respectively. After the dimension data of the electronic component is successfully obtained, it is stored in the built-in database according to the specific data structure provided by this method.

[0154] Step S20: Using the DSL lexical analyzer, its main task is to convert the input DSL source code into tokens, each token representing a smallest meaningful unit, such as a keyword, identifier, operator, number, etc.

[0155] Figure 3 The DSL source code conversion flow chart provided in the embodiment of the present application is as follows: Figure 3 As shown, step S20 specifically includes the following steps:

[0156] S201, initialization: set up the state machine, define various tag types (keywords, identifiers, numbers, operators, etc.) and regular expressions for their identification.

[0157] S202, reading characters: reading text in the DSL source file character by character.

[0158] S203, character classification:

[0159] Space and newline characters: Ignore spaces and newline characters in DSL source files.

[0160] Note: When a # symbol is encountered, read to the end of the line and discard it.

[0161] Keywords: Use regular expressions to match keywords such as from, import, as, export, footprint, etc.

[0162] Identifier: matches a sequence of letters, numbers, and underscores, but cannot start with a number. It is used for variable names, module nouns defined by keywords such as def, etc.

[0163] Number: matches an integer or floating point number.

[0164] Operators: recognize +, -, ^, >>, =, (,), {,}, [,],; and other operators.

[0165] String: matches any sequence of characters enclosed in double quotes " or single quotes '.

[0166] S204, generate a tag: each time a valid element is identified, a tag is generated, including a tag type and a corresponding value, and the location information of the tag is recorded.

[0167] S205, error handling: if an unrecognizable character combination is encountered, an error message is recorded and processing is stopped.

[0168] S206, outputting a tag sequence: if the entire DSL source file is processed, outputting a tag sequence generated by the DSL source file after the above steps are processed, and leaving it for subsequent syntax analysis processing.

[0169] Step S30: Using the DSL syntax analyzer, the main task is to parse the token sequence generated by the lexical analyzer into an abstract syntax tree (AST) and check whether the source code complies with the syntax rules of the DSL.

[0170] Figure 4 The abstract syntax tree generation flow chart provided in the embodiment of the present application is as follows: Figure 4 As shown, step S30 specifically includes the following steps:

[0171] S301. Initialization: Design context-free grammar and define grammatical rules, such as grammatical rules for main program, statement list, statement, import statement, export statement, package definition, body definition, pin definition, material definition, color definition, module definition, assignment statement, expression, term, factor, etc.

[0172] S302, read the token sequence: receive the token sequence processed by the DSL lexical analyzer.

[0173] S303, recursive descent parsing: for the grammar rules defined in the initialization step S301, each grammar rule defines a parsing processing function, and recursive descent parsing starts from the main program according to the corresponding grammar rule until each statement list, statement, expression, term and factor is parsed. At the same time, a stack is used to manage nested structures, such as the brace pairs used for nesting in module definitions.

[0174] S304, Generate AST node: DSL source code usually starts with an import statement, and the root node of the AST is generated based on this, representing the main program. Then, according to the token sequence input later, if a grammar rule is matched, a child node is initialized and newly generated, and the node type is set. After the processing is completed, the child node is returned. This processing step processes the token sequence generated by the DSL source code into a tree-structured abstract syntax tree (AST), which represents the logical structure of the source code.

[0175] S305, error handling: During the processing, if a tag that does not match any grammatical rule is found, a grammatical error is thrown and the error location and possible cause are recorded.

[0176] S306, output AST: If all token sequences have been processed and there are no syntax errors, then output AST for subsequent 3D interpreter processing.

[0177] Step S40: Using the 3D interpreter, process the abstract syntax tree (AST) generated by the DSL syntax analyzer, convert it into a three-dimensional geometric model of the electronic component, and export it into a 3D model file in a universal format for storage.

[0178] Figure 5 The three-dimensional geometric model construction flow chart provided in the embodiment of the present application is as follows: Figure 5 As shown, step S40 specifically includes the following steps:

[0179] S401 , input AST: receive AST generated by DSL syntax analyzer.

[0180] S402, AST traversal and analysis: Start processing from the root node of AST, recursively traverse the entire tree structure, analyze the types of different nodes, and map the corresponding processing logic functions.

[0181] S403, geometry construction and transformation: process the nodes that construct the geometry in AST, read the geometry shape and size information defined therein, and execute the corresponding geometry construction and transformation processing logic for different types of nodes. For example: for geometry primitive nodes, such as cube, sphere, cylinder, etc., create the corresponding basic 3D geometry. For operator nodes, such as +, -, ^, >>, etc., perform Boolean addition, Boolean subtraction, Boolean merge, stretching and other operations on the geometry. According to the characteristics of the electronic component, the geometry of the main part and the pin part are constructed separately. The pin part is merged into the main part through array or geometric position transformation to complete the geometry construction of the entire electronic component three-dimensional model.

[0182] S404, Material and Color Application: Process the nodes in the AST that define the colors of the main body and pin part geometries, and apply material and color attributes to the specified geometries.

[0183] S405, Generation and Optimization: Convert the geometry into a triangular mesh suitable for rendering and storage, reduce unnecessary vertices and faces, and optimize the model file size.

[0184] S406, exporting a 3D model file: according to the save statement node, selecting a suitable general format of the export file model, such as .STL, .OBJ, etc., and writing and storing the final 3D model data encoding into a specified 3D file.

[0185] Step S50: Output the electronic component 3D file, wherein the electronic component 3D file is the final output of the method of the present application, which can not only be persistently saved to a storage device such as a disk, but also be cached in memory for use by other programs.

[0186] A well-designed DSL can more accurately describe the geometric shape, electrical characteristics, etc. of electronic components in the automated creation of 3D models of electronic components, and can therefore be used for the precise creation of 3D models of electronic components. DSL can be easily integrated with EDA software, simulation tools, and manufacturing processes, making it easy to integrate and automate designs. In addition, for engineers familiar with electronic engineering design, using DSL can reduce the time required to learn new tools. Compared with manual modeling or parametric modeling, they can quickly get started and start creating 3D models of electronic components based on the concise syntax rules of DSL.

[0187] Domain-specific languages ​​(DSL) have broad application prospects in the automated creation of three-dimensional models of electronic components. For example, if a specific method can be used to automatically extract the dimensional data and graphic data of electronic components from the data manual of the electronic components, and automatically generate a DSL language script for the creation of the three-dimensional model of the electronic components, combined with the method of the present application, a fully automated process for the creation of three-dimensional models of electronic components can be achieved. Using DSL to create three-dimensional models of electronic components is also conducive to remote collaboration and sharing, without the need for relatively large three-dimensional model files themselves. In currently popular EDA software, the volume occupied by the three-dimensional model files released with the software is huge.

[0188] The electronic component three-dimensional model creation method provided in the embodiment of the present application can be applied in the following fields, including but not limited to:

[0189] 1) Electronic Design Automation (EDA): This application can be applied to the field of EDA design. In circuit board design software, the 3D model library of electronic components is automatically created or updated to improve design efficiency; this application is integrated into EDA tools to automatically generate 3D models from data sheets for simulation and layout optimization.

[0190] 2) Computer-aided design (CAD): This application can automatically import 3D models of electronic components into mechanical design projects to ensure consistency between electrical and mechanical designs; integration in CAD software simplifies the component selection and placement process and reduces manual modeling work.

[0191] 3) Supply Chain Management: Quickly generate 3D models in the product catalog, support online viewing and selection, and improve the purchasing experience; automatically generate 3D visualization of each component in the bill of materials (BOM) to facilitate inventory management and quality control.

[0192] 4) Virtual Reality and Augmented Reality (VR / AR): Use 3D models to create virtual demonstrations of electronic devices for training, maintenance, and customer experience; in an AR environment, field engineers can call up 3D models of electronic components through gestures or voice commands for troubleshooting.

[0193] 5) Education and Training: Provide interactive learning resources for electronic engineering students and professionals to help understand the working principles of complex components; create simulation environments for experimental teaching and skill assessment without the need for actual hardware.

[0194] The known and potential applications of this application are not limited to the above-mentioned ones. With the development and innovation of technology, more new application scenarios will continue to be discovered.

[0195] Figure 6 The present invention also provides a device for creating a three-dimensional model of an electronic component. Figure 6 As shown, the electronic component three-dimensional model creation device includes:

[0196] The data acquisition module 601 is configured to acquire DSL source code for constructing a three-dimensional model of an electronic component;

[0197] The lexical analysis module 602 is configured to use a DSL lexical analyzer to convert the DSL source code into a plurality of tokens to obtain a token sequence formed by the plurality of tokens;

[0198] The syntax analysis module 603 is configured to parse the tag sequence into an abstract syntax tree using a DSL syntax analyzer;

[0199] The model creation module 604 is configured to convert the abstract syntax tree into a three-dimensional geometric model of the electronic component using a 3D interpreter.

[0200] In some embodiments, the data acquisition module is further configured to input DSL source code for constructing a three-dimensional model of an electronic component based on set DSL grammar rules, and / or, based on the electronic component data manual, automatically generate DSL source code that complies with the set DSL grammar rules; the DSL grammar rules include the following semantic features: import and export: used to import set body, pin, material and color elements from the DSL built-in standard library; package: used to define the package electrical characteristics of the electronic component; body: used to define the body part geometry in the three-dimensional model of the electronic component; pin: used to define the pin part geometry in the three-dimensional model of the electronic component; material and color: used to define material keywords related to the appearance of the three-dimensional model, and keywords used to define the color of the geometry. Module definition: keywords used to customize the geometry module; geometric primitives: geometric primitive keywords used to create customized geometry.

[0201] In some embodiments, the lexical analysis module is further configured to set various token types and regular expressions for identifying token types, wherein the token types include keywords, identifiers, numbers, operators, and strings; read the text in the DSL source file character by character to identify valid elements: ignore spaces and line breaks in the DSL source file; if a set symbol is encountered, read to the end of the line and discard the read characters; use a regular expression to match a character or a character sequence to obtain a valid element; match a character sequence consisting of letters, numbers, and underscores to obtain a valid element; match an integer or a floating point number to obtain a valid element; identify a set operator to obtain a valid element, and match a character sequence surrounded by double quotes or single quotes to obtain a valid element; generate a tag each time a valid element is identified, wherein the tag includes the tag type, tag value, and tag position information; if an unrecognizable character sequence is encountered, an error message is recorded and processing is stopped; if the processing of the entire DSL source file is completed, a tag sequence formed by a number of tags is output.

[0202] In some embodiments, the syntax analysis module is further configured to: set context-free grammar and syntax rules, the syntax rules include main program, statement list, statement, import statement, export statement, package definition, body definition, pin definition, material definition, color definition, module definition, assignment statement, expression, item, factor; read token sequence; recursive descent parsing: define a parsing processing function for each syntax rule, and recursively descent parse from the main program according to the corresponding syntax rule until each statement list, statement, expression, item and factor are parsed. At the same time, a stack is used to manage nested structures, such as the brace pairs used in the module definition. Generate nodes of the abstract syntax tree: use the import statement as the root node of the abstract syntax tree to represent the main program, and according to the token sequence input later, if a certain syntax rule is matched, initialize and generate a new child node, set the node type, and return the child node after processing; if there is a tag that does not match any syntax rule, determine the syntax error, and record the error location and cause; if all tag sequences are processed and there is no syntax error, output the abstract syntax tree.

[0203] In some embodiments, the model creation module is further configured to: obtain an abstract syntax tree; start processing from the root node of the abstract syntax tree, recursively traverse the entire tree structure, analyze the types of different nodes, and map corresponding processing logic functions; process the nodes in the abstract syntax tree that construct geometric bodies, read the geometric body shape and size information defined therein, and for geometric primitive nodes, create corresponding geometric bodies; for operator nodes, perform Boolean addition, Boolean subtraction, Boolean merge and / or stretching operations on the geometric bodies; according to the characteristics of the electronic component, respectively construct the geometries of the main body and the pin part, and the pin part is merged into the main body through array or geometric position transformation to complete the geometric construction of the three-dimensional model of the electronic component; process the nodes in the abstract syntax tree that define the colors of the main body and pin part geometries, and apply material and color attributes to the specified geometry; convert the geometry into a triangular mesh suitable for rendering and storage.

[0204] In some embodiments, the device further includes a model storage module, and the model storage module is configured to: write and store the three-dimensional geometric model of the electronic component into a specified 3D file to obtain an electronic component 3D file.

[0205] The electronic component 3D model creation device provided in the embodiment of the present application can be used to execute the technical solution of the electronic component 3D model creation method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0206] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7As shown, the electronic device may include: a processor 71 and a memory 72 , wherein the processor 71 and the memory 72 may communicate with each other; illustratively, the processor 71 and the memory 72 communicate with each other via a communication bus 73 .

[0207] The processor 71 executes the computer execution instructions stored in the memory 72, so that the processor 71 executes the scheme in the above embodiment. The processor 71 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0208] The communication bus 73 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0209] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0210] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the method for creating a three-dimensional model of an electronic component in the above embodiment.

[0211] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the method for creating a three-dimensional model of an electronic component in the above embodiment.

[0212] 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. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0213] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0214] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0215] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0216] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0217] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0218] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0219] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0220] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0221] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0222] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for creating a three-dimensional model of an electronic component, characterized in that: include: Get the DSL source code for building 3D models of electronic components; Using a DSL lexical analyzer, converting the DSL source code into a plurality of tokens to obtain a token sequence formed by the plurality of tokens; Using a DSL parser, parsing the tag sequence into an abstract syntax tree; The abstract syntax tree is converted into a three-dimensional geometric model of the electronic component using a 3D interpreter.

2. The method according to claim 1, characterized in that Get the DSL source code for building 3D models of electronic components, including: Inputting a DSL source code for constructing a three-dimensional model of an electronic component based on a set DSL grammar rule, and / or automatically generating a DSL source code that complies with the set DSL grammar rule based on a data sheet of the electronic component; The DSL grammar rules include the following semantic features: Import and export: used to import the set body, pin, material and color elements from the DSL built-in standard library; Package: used to define the electrical characteristics of the package of electronic components; Body: used to define the main part geometry in the 3D model of electronic components; Pin: used to define the pin part geometry in the 3D model of electronic components; Materials and Colors: Keywords for materials that define the appearance of 3D models, and keywords for defining the color of geometry. Module definition: Keywords for custom geometry modules; Geometry primitives: Geometry primitive keywords used to create custom geometric figures.

3. The method according to claim 1, characterized in that: The DSL source code is converted into a plurality of tokens by using a DSL lexical analyzer, and a token sequence formed by the plurality of tokens is obtained, including: Setting various token types and regular expressions for identifying token types, wherein the token types include keywords, identifiers, numbers, operators, and strings; Read the text in the DSL source file character by character to identify valid elements: ignore spaces and newline symbols in the DSL source file; if a set symbol is encountered, read to the end of the line and discard the characters that have been read; use regular expressions to match characters or character sequences to get a valid element; match character sequences consisting of letters, numbers, and underscores to get a valid element; match integers or floating-point numbers to get a valid element; identify set operators to get a valid element, and match character sequences surrounded by double quotes or single quotes to get a valid element; Each time a valid element is identified, a tag is generated, wherein the tag includes tag type, tag value and tag position information; If an unrecognizable character sequence is encountered, an error message is recorded and processing stops; If the entire DSL source file is processed, a tag sequence formed by several tags is output.

4. The method according to claim 1, characterized in that: Using a DSL parser, the tag sequence is parsed into an abstract syntax tree, including: Setting context-free grammar and grammar rules, wherein the grammar rules include main program, statement list, statement, import statement, export statement, package definition, body definition, pin definition, material definition, color definition, module definition, assignment statement, expression, term, factor; Read the Token sequence; Recursive descent parsing: define a parsing function for each grammar rule, and recursively descent parse from the main program according to the corresponding grammar rule until each statement list, statement, expression, term, and factor is parsed. At the same time, use a stack to manage nested structures, such as the nested brace pairs used in module definitions. Generate an abstract syntax tree node: Use the import statement as the root node of the abstract syntax tree to represent the main program. According to the token sequence input later, if a certain syntax rule is matched, initialize and generate a new child node, set the node type, and return the child node after processing. If there are tags that do not match any grammatical rules, a grammatical error is determined and the error location and cause are recorded; If all token sequences are processed and there are no syntax errors, the abstract syntax tree is output.

5. The method according to claim 1, characterized in that Using a 3D interpreter, converting the abstract syntax tree into a three-dimensional geometric model of an electronic component, including: Get the abstract syntax tree; Start processing from the root node of the abstract syntax tree, recursively traverse the entire tree structure, analyze the types of different nodes, and map the corresponding processing logic functions; Processing nodes for constructing geometric bodies in the abstract syntax tree, reading geometric body shape and size information defined therein, creating corresponding geometric bodies for geometric primitive nodes; performing Boolean addition, Boolean subtraction, Boolean merging and / or stretching operations on geometric bodies for operator nodes; constructing the geometries of the main body and the pin part respectively according to the characteristics of the electronic component, and merging the pin part into the main body through array or geometric position transformation to complete the geometric construction of the three-dimensional model of the electronic component; Process the nodes in the abstract syntax tree that define the colors of the body and pin part geometries, and apply material and color attributes to the specified geometries; Convert geometry into a triangular mesh suitable for rendering and storage.

6. The method according to claim 1, characterized in that After converting the abstract syntax tree into a three-dimensional geometric model of an electronic component using a 3D interpreter, the method further comprises: The three-dimensional geometric model of the electronic component is written and stored in a specified 3D file to obtain the electronic component 3D file.

7. A device for creating a three-dimensional model of an electronic component, characterized in that: include: A data acquisition module is configured to acquire DSL source code for constructing a three-dimensional model of an electronic component; A lexical analysis module is configured to use a DSL lexical analyzer to convert the DSL source code into a plurality of tokens to obtain a token sequence formed by the plurality of tokens; A syntax analysis module, configured to parse the tag sequence into an abstract syntax tree using a DSL syntax analyzer; The model creation module is configured to convert the abstract syntax tree into a three-dimensional geometric model of the electronic component by using a 3D interpreter.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Cited By

  • Three-dimensional model generation method and device, storage medium and equipment

    CN120298606A

  • Encapsulation file generation method and device, electronic equipment and storage medium

    CN120407519A

  • Symbol file generation method and device, electronic equipment and storage medium

    CN120469972A

  • Part modeling method, device and equipment

    CN121256967A