Method, device and computer readable medium for reading a cad file on a web

By discretizing CAD files into visual and geometric files, the challenge of viewing on the web and editing in CAD software is solved, enabling seamless switching and efficient operation.

CN122132638APending Publication Date: 2026-06-02粤港澳大湾区(广东)国创中心
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
粤港澳大湾区(广东)国创中心
Filing Date
2026-01-27
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently view and edit CAD files on the web, and there are issues with accuracy loss or maintenance difficulties.

Method used

Save CAD files as visualization files and geometric files, including mesh data and scene data, for web-based display and CAD software editing, respectively. Discretization using discrete points and triangular faces supports viewing on the web and editing in CAD software.

Benefits of technology

It enables seamless switching between lightweight web-based display and editing in CAD software, avoiding cumbersome import and export operations and meeting the needs for model integrity and editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132638A_ABST
    Figure CN122132638A_ABST
Patent Text Reader

Abstract

This invention provides a method, device, and computer-readable medium for reading CAD files on a web interface. The method includes: saving the CAD file as a visualization file or a geometric file, wherein the CAD file contains at least one 3D model; displaying the 3D model on a web interface based on user selection; and displaying an editable 3D model in CAD software based on user selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of CAD file reading technology, and in particular to a method, device, and computer-readable medium for reading CAD files on a web interface. Background Technology

[0002] Currently, there are many types of 3D model formats, which can be divided into two categories from a usage perspective: one is CAD formats used for model editing. These formats can only be opened with specific CAD software. These formats contain a lot of modeling information, and the model file size is relatively large, usually reaching hundreds of MB, and sometimes even GB, making them unsuitable for distribution and viewing on the web. The other type is general-purpose model formats used for model viewing. These formats are usually universal and can be opened and viewed by most CAD software. These formats generally only contain mesh data, and the model size is relatively small. They can be quickly opened and viewed on the web, but if you want to edit them, you need to import them into modeling software and convert them. If you want to view them on other platforms, you need to convert and export them again, which is a cumbersome and time-consuming process.

[0003] Typically, CAD software developers do not extract lightweight web-based display platforms. Their focus is on enriching the functionality and usability of their CAD software, usually supporting the export of some common formats so that users can view or continue editing in other software. Web-based lightweight display platform service providers, on the other hand, do not provide CAD editing capabilities. Their focus is on expanding the richness of formats, supporting more common model formats, and providing better support for certain CAD formats, ensuring the integrity of these CAD format data.

[0004] Currently, CAD software developers typically offer two solutions for providing lightweight web-based display platforms to view the formats of their own or other CAD software on the web: 1. Enable the web 3D engine to support one or more common model formats and provide conversion services to convert the vendor's format or other CAD formats into a common format supported by the engine. The limitation of this approach is that the common format can only handle geometric data from CAD software developers, which may result in loss of accuracy. Furthermore, it cannot handle attribute data. If the data needs to be edited and then viewed again, it must be re-imported into the CAD software and then re-exported, which is inconvenient for management.

[0005] 2. Develop a new lightweight data format and provide conversion services to convert the vendor's format or other CAD formats into your own lightweight format. This lightweight format is controlled by the software developer and does not have the problem of precision loss. Attribute data can also be added, but the developer needs to maintain two formats, which is inconvenient to maintain, and there is still a situation where editing and viewing require re-importing and exporting. Summary of the Invention

[0006] In order to solve the problems existing in the prior art, the present invention aims to provide a method, device and computer-readable medium for reading CAD files on a web interface, which can simultaneously open CAD files on a web interface and edit CAD files on CAD software.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: A method for reading CAD files on a web interface includes: Save the CAD file as a visualization file or a geometric file. The CAD file must contain at least one 3D model. Display 3D models on the web based on user selection; Based on the user's selection, an editable 3D model is displayed in the CAD software.

[0008] As a further improvement of the present invention, the visualization file includes: grid data and scene data.

[0009] As a further improvement of the present invention, the step of saving the CAD file as a visualization file includes: Based on the accuracy of the data saved, the curve is discretized into discrete points; Discretize the curved surface into triangular faces; Save the discrete points as grid data according to the original order of the curve, and save the arrangement order of the discrete points as scene data; Save the triangle face and its vertices as mesh data, and save the vertex position, the normal of the triangle face containing the vertex, and the coordinate information of the texture as scene data.

[0010] As a further improvement of the present invention, the step of saving the CAD file as a visualization file includes: The number of geometric objects in the CAD file is recorded using a 32-bit integer type; The data is recorded using a 32-bit integer type, including the number of faces, vertex texture data length, vertex position data length, vertex normal data length, index data length, number of midlines, number of line discrete points, number of midpoints, face vertex texture data, vertex position data, vertex normal data, index data, line discrete point data, and point data.

[0011] As a further improvement of the present invention, the step of saving the CAD file as a geometric file includes: Save intermediate data on the geometry and topology of the CAD file modeling kernel.

[0012] As a further improvement of the present invention, the step of loading the visualization file on the web based on the user's selection includes: Load the visualization file; The model in the CAD file is drawn based on the grid data and scene data.

[0013] As a further improvement of the present invention, the visualization file further includes: the name of the geometry file; Based on the visualization file, find the geometry file by its name; Based on the modeling kernel type of the geometry file; Load the corresponding modeling kernel link library into the CAD software; Based on visualization and geometry files, display editable 3D models in CAD software.

[0014] The present invention also provides an electronic device, comprising: CAD software, a file system, and a lightweight web platform, wherein the CAD software, the file system, and the lightweight web platform store at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method described above.

[0015] The present invention also provides one or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the methods described above.

[0016] The beneficial effects of this invention are as follows: by saving CAD files as visual files and geometric files, the needs of CAD software model editing and lightweight display on the Web are met. Users can view the model on the Web and edit the model in CAD software without having to perform cumbersome import and export operations. Attached Figure Description

[0017] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0018] Figure 1 This is a flowchart of the method described in this invention.

[0019] Figure 2 This is a process diagram illustrating the method described in this invention; Figure 3 This is another flowchart of the method described in this invention; Figure 4 This is a schematic diagram illustrating the storage of the visual file described in this invention; Figure 5 This is a frame diagram of the electronic device described in this invention. Detailed Implementation

[0020] To make the technical problems solved by the present invention, the technical solutions adopted, and the technical effects achieved clearer, the technical solutions of the embodiments of the present invention will be further described in detail below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] This invention provides a method for reading CAD files on a web interface, such as... Figures 1-3 As shown, it includes: S1. Save the CAD file as a visualization file and a geometry file. The CAD file must contain at least one 3D model. Before this, the user needs to save the CAD file in ncti file format. Subsequently, the ncti file format is divided into two files: a visualization file and a geometry file, which are then saved.

[0022] like Figure 4 As shown, the visualization file is a binary file, including mesh data and scene data, which can be directly displayed as lightweight data. Specifically, the steps to save a CAD file as mesh data include: Based on the accuracy of the data saved, the curve is discretized into discrete points; Discretize the curved surface into triangular faces; Save the discrete points as grid data according to the original order of the curve, and save the arrangement order of the discrete points as grid data; Save the triangle face and its vertices as mesh data, and save the position of the vertex, the normal of the triangle face containing the vertex, and the coordinate information of the texture as mesh data.

[0023] Mesh data consists of discretized points, triangles, and index data. For example, a curve is discretized into several points based on the precision at which it is saved. These points are stored sequentially in the visualization file and are drawn sequentially and connected to display the curve. If it is a surface, it is discretized into several triangles based on the precision at which it is saved. Each vertex contains the position of the point, the normal of the triangle containing the point, and the coordinate information of the texture. These vertices are also stored in the visualization file. The vertices are found by using the index that forms the triangular mesh to draw the surface.

[0024] The steps to save a CAD file as scene data include: The number of geometric objects in the CAD file is recorded using a 32-bit integer type; The data is recorded using a 32-bit integer type, including the number of faces, vertex texture data length, vertex position data length, vertex normal data length, index data length, number of midlines, number of line discrete points, number of midpoints, face vertex texture data, vertex position data, vertex normal data, index data, line discrete point data, and point data.

[0025] The scene data records the organizational structure of all geometry in the file. A scene may contain one or more geometry. A geometry contains points, lines, and faces. The scene data first records the number of geometry using a 4-byte integer type. Then, it records the number of faces of each geometry and the length of vertex texture data, vertex position data, vertex normal data, and index data of each face using integer types. It also records the number of lines and the number of discrete points of each line in each geometry, as well as the number of points in each geometry. After that, it records the vertex texture data, vertex position data, vertex normal data, and index data of the specific faces, the data of discrete points of the lines, and the data of the points.

[0026] Specific methods for saving CAD files as geometric files include: saving intermediate data of the geometric and topological structures of the CAD file modeling kernel, such as the Open CASCADE kernel and the Parasolid kernel, which have corresponding intermediate data of geometric and topological structures, recording the geometric construction and topological relationships of the geometric objects. For example, a circle will record its origin coordinates and radius, and a B-spline curve will record its control points, node vectors, curve degree, and control point weights, etc. The topological relationships are similar to the scene data in the geometric part, recording which points are connected to form edges, which edges form faces, and which faces constitute geometric objects. This part can be found in existing technologies.

[0027] One integer type (e.g., 26): the number of geometric elements. A cube has 26 elements (8 points, 12 edges, and 6 faces). 26 integer types (e.g., 0-25): record the ID value of each element, enabling element-level picking and editing; One integer type (e.g., 6): records the mesh structure of 6 faces. The following is the mesh structure of each face; One integer type (e.g., 0): records the number of texture coordinates of the mesh vertices; 0 if there are no textures. One integer type (e.g., 12): Records the number of positions of the grid vertices. Each face is a quadrilateral with four points. Each point is represented by three values: x, y, and z. Therefore, a total of 12 values ​​are needed. One integer type (e.g., 12): records the number of normals to the mesh vertices, consistent with the number of position points; One integer type (e.g., 6): records the number of grid indices. A quadrilateral can be divided into two triangular faces, and 6 values ​​are needed to record how the four vertices form these two triangles. 72 floating-point values: These record the specific vertex position coordinates. There are 6 faces, each with 12 values, for a total of 72 values. 72 floating-point types: record specific vertex normal values, consistent with the coordinate values ​​of the position points; 36 integer types: These record the specific grid index values. There are 6 faces, and each face has 6 indices, for a total of 36 values. One integer type (e.g., 12): indicates that data for 12 edges should be read, followed by the number of values ​​for each edge; One integer type (e.g., 6): Records the number of values ​​that make up the edge. Here, only two points are needed to form this edge, and each point has three values, so 6 values ​​are needed. 72 floating-point values: These record the specific position of each edge. There are 12 edges here, each with 6 values, for a total of 72 values. One integer type (e.g., 8): indicates that a number with 8 points should be read; 24 floating-point types: These record the position of specific points. There are 8 points here, each represented by three values: x, y, and z, for a total of 24 values.

[0028] S2. Based on the user's selection, display the 3D model on the web. The visualization file serves as the entry file for loading the model on the web. If the user chooses to view the model in a lightweight manner on the web, only the visualization file needs to be loaded. Based on the mesh data and scene data, construct the structure of each geometry and combine the point, line, and surface data of the geometry to draw the model in the CAD file.

[0029] S3. Based on the user's selection, display an editable 3D model in the CAD software. The visualization file also includes: the name of the geometry file and the modeling kernel type. The visualization file serves as the entry point for the CAD software, allowing the corresponding geometry file to be located. Specifically, based on the visualization file, the geometry file is located by its name; according to the modeling kernel type of the geometry file; the corresponding modeling kernel's link library is loaded into the CAD software, providing modeling capabilities; based on the scene data, mesh data, and intermediate data in the visualization file and geometry file, the model's topological relationships are determined, and the editable 3D model is displayed in the CAD software.

[0030] When CAD software loads an ncti file, it loads the corresponding kernel link library based on the kernel type of the visualization file, and at the same time loads the intermediate data in the geometry file, so that the modeling capabilities of that kernel can be used for model editing.

[0031] The invention will now be described in conjunction with specific application scenarios: In CAD software modeling scenarios, users need to select a modeling kernel as the engine for model editing. After editing the model and saving it in NCTI format, the discretized geometric data is retrieved from the modeling kernel and exported as a visualization file in conjunction with the CAD software's model scene. Simultaneously, the intermediate geometric and topological data of the modeling kernel are saved as a geometry file. If an NCTI file is opened for further editing, the CAD software searches for the corresponding geometry file in the visualization file. By determining which kernel the geometry file belongs to, it identifies the link library to load and quickly loads the model using the scene data from the visualization file and the geometry file, entering the editing state. If the geometry file is lost, it will not affect the use of the NCTI file; the kernel type will be retained in the visualization file. Using the kernel's modeling capabilities, the discretized discrete points and triangular faces are restored to parametric and topological data, allowing continued 3D model editing. However, this adds conversion operations, increasing file opening time. In a lightweight web-based viewing scenario, users only need to upload the visualization file, and the lightweight engine can directly display the 3D model by parsing the mesh data.

[0032] Therefore, the beneficial effects of this invention are as follows: only one model format needs to be maintained to meet the needs of CAD software model editing and lightweight display on the Web. This ncti file format separates the model's visual mesh data and geometric data into two parts. The visual mesh part contains the model's mesh data and attribute data for lightweight display, while the geometric part contains the model's geometric kernel information and modeling context. By overlaying the visual mesh part data, the model can be edited in the CAD software. Users can try to view the model's editing status in the CAD software on the Web, without having to perform cumbersome import and export operations.

[0033] Based on the same inventive concept, the present invention also provides an electronic device, such as... Figure 5 As shown, it includes: CAD software, a file system, and a lightweight web platform. The CAD software, the file system, and the lightweight web platform store at least one instruction. The at least one instruction is loaded and executed by the processor to implement the method described above. The processor is used to implement the method described above when executing the program stored in the memory.

[0034] In a real-time process, users select a modeling kernel in CAD software, edit the 3D model, and save it as an ncti file. They also save the visualization and geometry files to the file system. When a user opens an ncti file, the CAD software searches for the corresponding geometry file within the visualization file. By determining which kernel the geometry file belongs to, it identifies the link library to load. Combining the scene data from the visualization file and the geometry file, the software quickly loads the model and enters the editing state. Even if the geometry file is lost, it doesn't affect the use of the ncti file; the kernel type is retained in the visualization file. The kernel's modeling capabilities allow discretized points and triangular faces to be restored to parametric and topological data, enabling continued 3D model editing. However, this adds conversion operations, increasing file opening time. In a lightweight web-based viewing scenario, users only need to upload the visualization file, and the lightweight engine can directly display the 3D model by parsing the mesh data.

[0035] Based on the same inventive concept, the present invention provides one or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the methods described above.

[0036] In this description, references to terms such as "an embodiment," "example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0037] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style of the specification is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0038] The technical principles of the present invention have been described above with reference to specific embodiments. These descriptions are merely for explaining the principles of the invention and should not be construed as limiting the scope of protection of the invention in any way. Based on this explanation, those skilled in the art can readily conceive of other specific embodiments of the invention without inventive effort, and these embodiments will all fall within the scope of protection of the present invention.

Claims

1. A method for reading CAD files via a web interface, characterized in that, include: Save the CAD file as a visualization file or a geometric file. The CAD file must contain at least one 3D model. Display 3D models on the web based on user selection; Based on the user's selection, an editable 3D model is displayed in the CAD software.

2. The method according to claim 1, characterized in that, The visualization file includes: grid data and scene data; The step of saving the CAD file as a visualization file includes: saving the CAD file as mesh data and scene data.

3. The method according to claim 2, characterized in that, The step of saving the CAD file as grid data includes: Based on the accuracy of the data saved, the curve is discretized into discrete points; Discretize the curved surface into triangular faces; Save the discrete points as grid data according to the original order of the curve, and save the arrangement order of the discrete points as grid data; Save the triangle face and its vertices as mesh data, and save the position of the vertex, the normal of the triangle face containing the vertex, and the coordinate information of the texture as mesh data.

4. The method according to claim 3, characterized in that, The step of saving the CAD file as scene data includes: The number of geometric objects in the CAD file is recorded using a 32-bit integer type; The data is recorded using a 32-bit integer type, including the number of faces, vertex texture data length, vertex position data length, vertex normal data length, index data length, number of midlines, number of line discrete points, number of midpoints, face vertex texture data, vertex position data, vertex normal data, index data, line discrete point data, and point data.

5. The method according to claim 1, characterized in that, The step of saving the CAD file as a geometric file includes: Save intermediate data on the geometry and topology of the CAD file modeling kernel.

6. The method according to claim 2, characterized in that, The step of loading the visualization file on the web based on the user's selection includes: Load the visualization file; The model in the CAD file is drawn based on the grid data and scene data.

7. The method according to claim 5, characterized in that, The visualization file also includes: the name of the geometry file; The step of displaying an editable 3D model in CAD software based on user selection includes: Based on the visualization file, find the geometry file by its name; Based on the modeling kernel type of the geometry file; Load the corresponding modeling kernel link library into the CAD software; Based on visualization and geometry files, display editable 3D models in CAD software.

8. An electronic device, characterized in that, include: The CAD software, the file system, and the lightweight web platform store at least one instruction, which is loaded and executed by the processor to implement the method as described in any one of claims 1 to 8.

9. One or more computer-readable media, characterized in that, It stores instructions that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-8.