Method for rendering two-dimensional image to designer
By generating combined transformations with quad precision in the CAD system, the problem of inaccurate cropping of part instances in the viewport plane under double precision is solved, robust rendering of distant part instances is achieved, ensuring the accuracy of rendering results and reducing to calculate the cost.
Patent Information
- Application Number
- CN202380016922.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-14
- Filing Date
- 2023-01-09
- Publication Date
- 2024-08-27
AI Technical Summary
In computer-aided design (CAD) systems, the double-precision calculation accuracy limits the accurate rendering of the assembly of the component instance in the viewport plane, especially when the component instance is far away from the viewport boundary, resulting in inaccurate or incorrect cropping. .
Ensure accuracy in generating clip lines and clip points by defining a parametric viewport plane in viewport prototype space and generating combined transformations with quad precision, including transformations associated with the part instance, viewport, and viewport plane , to avoid loss of accuracy.
It achieves robust cropping of distant component instances without losing accuracy, ensuring the accuracy and visibility of rendering results, and reducing the impact of high computational cost quad-precision conversion on system performance.
Smart Images

Figure CN118556237A
Abstract
Description
[0001] This patent document claims the benefit of U.S. Provisional Patent Application No. 63 / 299,689, filed on January 14, 2022, which is incorporated herein by reference in its entirety. Technical Field
[0002] The present disclosure relates to a computer-implemented method for rendering to a designer a two-dimensional image of an assembly of component instances in a three-dimensional assembly space within a computer-aided design (CAD) system that utilizes double precision to describe the component assembly, wherein each component instance in the assembly is associated with its own prototype space and a transformation that transforms the component instance from its prototype space to the assembly space. Background Art
[0003] Computer-aided design (CAD) technology is widely used in many product design fields. This technology enables designers to generate designs in three dimensions from a wide variety of components and component instances, and to visualize the elements of these designs in two dimensions and three dimensions at different nodes during the design process. Designers may want to render the elements of the design as two-dimensional images after performing operations during the design process or once the design process is completed. The rendering system provided as part of the CAD software requires a variety of capabilities because the area of interest to be rendered in two dimensions may have a variety of features or attributes. An example of this situation is that the component instances in the assembly contain small-scale details and features, such as surface texture or topography, while the component instances themselves are at a large distance from each other or from the nominal viewpoint of the observer. The large distance is several orders of magnitude larger than the size of the details or features of interest, so the rendering system is required to accurately present the image portion where the relative size and / or position of the component instances may be very different. It may be useful for designers to be able to specify one or more "viewports", which are the areas where the designer requires the output to be rendered. Any face or edge of a component instance that appears within the viewport will be rendered, while any face or edge that appears outside the viewport will not be rendered. Any face or edge that intersects the border of the viewport can be rendered or clipped to the viewport, and the clipping line and clipping point are output to the underlying graphics system that displays the face occurrence or edge occurrence at which it is clipped. Lines that meet the border of the viewport will be clipped at the clipping point, which allows only the portion within the viewport to be rendered. Faces clipped by the viewport face will be clipped at the clipping line. The clipping line can be a curve constructed for the rendering process (e.g., formed by multiple line segments).
[0004] The viewport itself is an area of a two-dimensional image plane that may correspond to a rectangular quadrilateral, such as a square or rectangle that covers only the area that the designer wishes to have a rendered image. A three-dimensional viewport may also be defined as a region in the assembly space. The designer has two types of rendering choices: parallel rendering, where all features of the assembly within the viewport are viewed at actual size, and perspective rendering, where all features are rendered based on their perspective from a nominal viewpoint. Figure 1a and Figure 1b These two types of rendering are schematically shown in FIG.
[0005] Figure 1a It is a schematic diagram of two-dimensional parallel rendering. In the process of processing the assembly of component instance 1, the designer hopes to render a part 2 of the assembly in a parallel manner in the two-dimensional image plane 3 after completing the operation. The designer defines a quadrilateral viewport 4 on the two-dimensional image plane 3 and a viewing direction D in vector format. The viewing direction D is parallel to the surface normal N of the two-dimensional image plane 3 in which the viewport 4 is placed. Four viewport planes 5a, 5b, 5c, 5d are parameterized by a set of points and are parallel to the viewing direction D and extend from each side of the viewport 4. Since any feature of the assembly of component instance 1 that falls within the viewport 5 will be rendered according to its actual size, the viewport 4 and the viewport planes 5a, 5b, 5c, 5d form the five sides of an infinitely long cuboid.
[0006] Figure 1b is a schematic diagram of a two-dimensional perspective rendering. During the processing of an assembly of a component instance 6, the designer wishes to render a portion 7 of the assembly in perspective in a two-dimensional image plane 8 after the operation is completed. The designer defines a quadrilateral viewport 9 on the two-dimensional image plane 8 and a notional viewpoint 10 called an eyepoint, where an imaginary observer of the two-dimensional image plane 8 is placed. The four viewport planes 11a, 11b, 11c, 11d are parameterized by a set of points and extend from the edges of the viewport 9 to the vertex at the viewpoint 10, forming an infinitely long pyramid.
[0007] In addition to the constraints imposed on the rendering system by potential differences in the relative size and position of features within the assembly of component instances, the precision of the operation of the CAD system may cause problems for obtaining accurate visibility calculations. CAD systems can operate in double precision, which is based on the IEEE 754 double-precision binary floating point format, also known as binary64. The 64-bit string is divided into a single sign bit (bit 63), 11 exponent bits (bits 62 to 52) representing an unsigned integer from 0 to 2047, and 52 fractional bits (bits 51 to 0) representing a significant digit precision of 15 significant digits. For CAD systems, although the use of double precision is attractive from a computational cost perspective, this limits the accuracy of the calculations because only 15 significant digits are available. One effect of this is that the effective volume of the assembly of component instances and the parameterized three-dimensional points that define the viewport plane are limited due to the loss of precision when generating relative transformations. This limitation effectively defines a system operating area within which the accuracy of the calculations may be limited, but acceptable. In some CAD environments, such as the Parasolid PLM software available at https: / / www.plm.automation.siemens.com / global / en / products / plm-components / parasolid.html, the usual range for calculations is 10 11 Outside the system's operating area, the intersection between the viewport plane and face instances within component instances within an assembly is not robust or accurate to the required precision. This is particularly a problem if the face contains features that are on the order of the system's precision or slightly larger. If such a feature falls near the border of the viewport, it may end up being clipped incorrectly or determined to be on the wrong side of the viewport plane, resulting in incorrect visibility calculations.
[0008] One way to handle this problem is to adopt quadruple precision throughout the CAD system. This can be done using the IEEE 745-2008 128-bit base 2 format, i.e., binary128, which includes a single sign bit (bit 127), 15 exponent bits (bits 126 to 112) representing unsigned integers from 0 to 16382, and 112 fraction bits (bits 111 to 0) representing a significant digit precision of 34 significant digits, or by using a technique called "double-double arithmetic," in which pairs of double-precision values are used. While quadruple precision improves the accuracy of calculations, it is computationally expensive in terms of both resources and time. In addition to increasing computation time, any existing double-precision CAD models will need to be rewritten to run at quadruple precision, which in itself is highly labor-intensive and therefore unattractive to designers, unless increased processing power and storage space are available. Compared to quad precision, using double-double arithmetic is limited in the order of magnitude of values that can be represented, since the number of exponent bits is still only 11 compared to 15. While some calculations below a certain exponent size may be only slightly less accurate in double-double arithmetic than in quad precision, this is not the case for larger values.
[0009] As an alternative, a viewport can be constructed in viewing space, and multiple instances of the viewport created by transforming the viewport into the individual prototype spaces of untransformed component instances in the assembly. The prototype space of a component, also called component space or entity prototype space, is the space in which a component instance exists before any transformations to the assembly space are applied. Prototype space is the local coordinate space of the component instance, compared to the global assembly space of the assembly. While this does not incur the high computational cost of converting the entire model to quad precision, the transformed points used to parameterize the viewport planes may still be outside the valid volume of the component instance and may be subject to the issues with the visibility calculations described above. Summary of the invention
[0010] The present disclosure aims to solve these problems by providing a computer-implemented method in a first instance for rendering a two-dimensional image of an assembly of component instances in a three-dimensional assembly space to a designer in a computer-aided design (CAD) system that uses double precision to describe the component assembly, wherein each component instance in the assembly is associated with its own prototype space and a transformation that transforms the component instance from its prototype space to the assembly space. The method includes: receiving a definition of a two-dimensional image plane (in which the two-dimensional rendered image is viewed) and a viewpoint (from which the two-dimensional rendered image is viewed) or a viewing direction; also receiving a viewport that is located in the two-dimensional image plane and represents a desired portion of the two-dimensional image plane that the designer wishes to view; defining a parameterization of a set of viewport planes in a viewport prototype space by selecting points in each of the viewport planes to create a three-dimensional shape, the viewport planes extending from the viewport to the viewpoint or parallel to the viewing direction, the set of viewport planes and the viewport being associated with a transformation from the viewport prototype space to the assembly space; generating a combined transformation in quadruple precision, the combined transformation The invention comprises: a transformation associated with a component instance in an assembly; a transformation associated with the viewport and the set of viewport planes; and a transformation that scales and / or translates the viewport with the set of viewport planes; operating on the combined transformation and the points defining the viewport planes in double precision to intersect the face and / or edge of at least one component instance in the assembly with at least one of the viewport planes to generate clipping lines and / or clipping points, which clip the face and edge of the component instance in the assembly to the portion of the assembly located within the viewport; and rendering output of a two-dimensional image of the assembly of the component instances, wherein the clipping lines and / or clipping points are used to limit the rendering to the portion of the assembly located within the viewport.
[0011] The embodiments described below map the assembly clipping problem to a series of sub-problems in each prototype space using appropriate combined transforms in quad precision, where all geometric entities are within the effective assembly volume. This enables robust computation of the clipping of the rendered assembly without loss of precision when component instances within the assembly are at large distances from the nominal observer.
[0012] Transformations associated with component instances in an assembly and transformations associated with a viewport and a set of viewport planes may be provided with quad precision. Alternatively, transformations associated with component instances in an assembly and transformations associated with a viewport and a set of viewport planes may be upgraded to quad precision.
[0013] The two-dimensional image may be rendered as a perspective view, wherein an eyepoint defining a position of an observer at the viewpoint is also received, and wherein the three-dimensional shape is a pyramid having a viewport at its base and an eyepoint at its vertex. In this case, the combined transformation includes a transformation associated with a component instance in the assembly, a transformation associated with the viewport and a set of viewport planes, and a transformation that scales the viewport and the set of viewport planes.
[0014] Alternatively, the two-dimensional image may be rendered as a parallel view, where the three-dimensional shape is a prism with the viewport as the base. The two-dimensional image may be rendered as a parallel view, where the three-dimensional shape is a cuboid with the viewport as the base. In both cases, the combined transformations include: transformations associated with component instances in the assembly, transformations associated with the viewport and a set of viewport planes, and transformations that translate the viewport and a set of viewport planes. The viewing direction may be parallel to the surface normal of the two-dimensional image plane.
[0015] The effective volume of the assembly space and the parameterized points defining the viewport plane may be restricted to a system operating region, wherein at least one component instance in the assembly is located outside of the system operating region.
[0016] The faces of the component instances in the assembly that are clipped to the viewport contain the features of interest.
[0017] Quad precision can be used only when generating combined transforms.
[0018] In a second aspect, an embodiment of the present disclosure further provides a computer program comprising instructions, which, when executed on a computer, causes the computer to perform the above steps.
[0019] In a third aspect, an embodiment of the present disclosure also provides a data processing system suitable for rendering a two-dimensional image of an assembly of component instances in a three-dimensional assembly space to a designer in a computer-aided design (CAD) system that uses double precision to describe a component assembly, wherein each component instance in the assembly is associated with its own prototype space and a transformation that transforms the component instance from its prototype space to the assembly space. The data processing system includes: a designer input device suitable for receiving a definition of a two-dimensional image plane (in which the two-dimensional rendered image is viewed) and a viewpoint (from which the two-dimensional rendered image is viewed) or a viewing direction; also receiving a viewport that is located in the two-dimensional image plane and represents a desired portion of the two-dimensional image plane that the designer wishes to view; a data processor configured to define a parameterization of a set of viewport planes in a viewport prototype space by selecting points in each viewport plane in the viewport plane to create a three-dimensional shape, the viewport plane extending from the viewport to the viewpoint, the viewport and the set of viewport planes being associated with a transformation from the viewport prototype space to the assembly space; generating a combined transformation in quadruple precision, the set The combined transformation includes: a transformation associated with a component instance in the assembly; a transformation associated with the viewport and the set of viewport planes; and a transformation that scales and / or translates the viewport with the set of viewport planes; operating on the combined transformation and points defining the viewport planes in double precision to intersect a face and / or edge of at least one component instance in the assembly with at least one of the viewport planes to generate clipping lines and / or clipping points that clip the face and edge of the component instance in the assembly to a portion of the assembly that is within the viewport; and a graphics system adapted to output a rendering of a two-dimensional image of the assembly of component instances, wherein the clipping lines and / or clipping points are used to restrict the rendering to the portion of the assembly that is within the viewport
[0020] The data processor may also be configured to employ quad precision only when generating the combined transform. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The present disclosure will now be described, by way of example only, and with reference to the accompanying drawings, in which:
[0022] Figure 1a It is a schematic diagram of 2D parallel rendering;
[0023] Figure 1b It is a schematic diagram of a 2D perspective rendering;
[0024] Figure 2 is a schematic diagram of an example of an assembly of component instances rendered in perspective as a two-dimensional image;
[0025] Figure 3 is based on Figure 2 a second schematic diagram of an example of an assembly of a component instance rendered in perspective as a two-dimensional image;
[0026] Figure 4 is a schematic diagram of an example of an assembly of component instances rendered in a parallel manner as a two-dimensional image;
[0027] Figure 5 is based on Figure 4 a second schematic diagram of an example of an assembly of component instances rendered in a parallel manner as a two-dimensional image;
[0028] Figure 6 is a flowchart illustrating a method according to an embodiment of the present disclosure;
[0029] Figure 7a is a schematic diagram of the function of scaling transformation in perspective rendering according to an embodiment of the present disclosure;
[0030] Figure 7b is a schematic diagram of the function of translation transformation in parallel rendering according to an embodiment of the present disclosure; and
[0031] Figure 8 An example of a data processing system in which embodiments of the present disclosure may be implemented is shown, such as a CAD system configured to perform the processes as described herein. DETAILED DESCRIPTION
[0032] To overcome the limitations of the system operating area when rendering a two-dimensional image as described above, an embodiment of the present disclosure employs a scheme that generates combined transforms with quad precision during the rendering process while maintaining double precision for the rest of the design within the CAD system. A combined transform is performed on the points defining the viewport plane so that the faces and / or edges of at least one component instance in the assembly intersect with at least one of the viewport planes to generate clipping lines and / or clipping points. Compared to the case where the points defining the viewport plane parameterization and the component instances being rendered are both within the system operating area, the embodiments of the present disclosure do not lose accuracy when used in the case where the points defining the viewport plane parameterization specified by the designer or the component instances being rendered are located outside the system operating area.
[0033] Embodiments of the present disclosure are used to render a two-dimensional image of an assembly of component instances within a three-dimensional assembly space to a designer in a computer-aided design (CAD) system that uses double precision to describe a component assembly. Each component instance in the assembly is associated with its own prototype space and a transformation that transforms the component instance from its prototype space to the assembly space. Initially, a definition of a two-dimensional image plane (in which the two-dimensional rendered image is viewed) and a viewpoint (from which the two-dimensional rendered image is viewed) or a viewing direction is received; a viewport is also received, which is located in the two-dimensional image plane and represents a desired portion of the two-dimensional image plane that the designer wishes to view. Depending on the workflow of the design process in use, this can be input by the designer or obtained from designer preferences previously or earlier defined in the design process. Once the boundaries for the rendering process have been received, a parameterization of a set of viewport planes extending from the viewport to the viewpoint is defined in the viewport prototype space by selecting points in each viewport plane to create a three-dimensional shape. The set of viewport planes and the viewport are associated with a transformation from the viewport prototype space to the assembly space. Up to this point, everything has been defined in double precision, although transforms associated with component instances, viewports, and scaling and / or translation may be provided in quad precision or alternatively upgraded to quad precision. However, a combined transform is now generated in quad precision. The combined transform includes transforms associated with component instances in the assembly; transforms associated with the viewport and the set of viewport planes; and transforms for scaling and / or translating the viewport and the set of viewport planes. Once the combined transform has been generated, the points defining the viewport planes in double precision are operated on to intersect the faces and / or edges of at least one component instance in the assembly with at least one of the viewport planes to generate clipping lines and / or clipping points that clip the faces and edges of the component instances in the assembly to the portion of the assembly that is within the viewport. While the combined transform itself is in quad precision, the parameterization of the viewport planes remains in double precision, as do the clipping lines and / or clipping points. Finally, a rendering of a two-dimensional image of the assembly of component instances is output. The clipping lines and / or clipping points are used to restrict rendering to the portion of the assembly that is within the viewport.
[0034] Embodiments of the present method are now described in more detail. Figure 2is a schematic diagram of an assembly of component instances rendered as a two-dimensional image in perspective. The assembly 20 of component instances includes at least one component instance 21, which can be any three-dimensional shape with faces connected by edges. For example, the assembly can be the layout of a production line, where it is necessary to be able to plan the factory floor space and the positioning of elements including components such as robots, storage devices, workstations, etc., in order to maximize manufacturing efficiency and the health and safety of workers. Each component instance 21 is located in its own prototype space, which is the local component space in which the component instance is located before any transformation is applied during the modeling operation to generate the design. Each component instance is also associated with a transformation that transforms the component instance from its prototype space to the assembly space. The viewpoint 22 is selected as the eyepoint of the nominal observer. The two-dimensional image plane p is provided with a viewport 23, which in this example is a rectangle with two opposing long sides 24d, 24b and two opposing short sides 24c, 24a. A set of points that parameterize a set of viewport planes 25a, 25b, 25c, 25d are defined so that each viewport plane 25a, 25b, 25c, 25d extends from an associated edge 24a, 24b, 24c, 24d of the viewport and is connected at a vertex defined by the viewpoint 22. The viewport 23 and the set of viewport planes 25a, 25b, 25c, 25d are each defined in their own prototype space, which is independent of the prototype space of the component instance 21. The viewport 23 and the set of viewport planes 25a-25d are associated with a transformation from the viewport prototype space to the assembly space. A point 26 in the middle of the viewport plane 25a is selected for parameterization, rather than the viewpoint 22, because the eye point of the nominal observer must remain at a fixed point in subsequent imaging calculations. However, in other examples, point 26 can be located anywhere in the viewport plane 25a, not necessarily at the center. In one example, each transform is defined in double precision, so a conversion to quad precision is required when generating the combined transform, as described below. Alternatively, the transforms are defined in quad precision, and so can be combined without any modification. As described further below, there is no restriction on the precision with which the scaling and / or translation transforms are defined before generating the combined transform.
[0035] Figure 3 is based on Figure 2 A second schematic diagram of the assembly of the component instances rendered in perspective as a two-dimensional image. Figure 3A situation is shown where the assembly 20 of a component instance 21 is positioned at a large distance from a point 26 of a parameterized viewport plane 25a. The viewport plane 25a is within the system operating region, but the assembly 20 of the component instance 21 is outside the system operating region. A point 26 within the viewport plane 25a and the surface normal vector N defining the viewport plane 25a and the parameterization are shown. If the visibility calculation is made at this point using only the appropriate transformation defined in double precision, it will be incorrect. For example, a small feature of a component instance that is close to one edge of the viewport 23 may end up being incorrectly clipped or determined to be on the wrong side of the viewport plane 25a. However, by generating a combined transformation with quad precision when operating on a point 26 on the viewport plane 25a, even though the parameterization of the viewport plane 25a is defined in double precision, the point 26 that parameterizes the viewport plane 25a and the component instance 21 being rendered are both within the operating region.
[0036] Figure 4 It is a schematic diagram of an assembly of component instances rendered as a two-dimensional image in a parallel manner. The assembly 40 of component instances includes at least one component instance 41, which can be any three-dimensional shape with faces connected by edges. Each component instance 41 is located in its own prototype space, which is the local component space in which the component instance is located before any transformation is applied during the modeling operation to generate the design. Each component instance is also associated with a transformation that transforms the component instance from its prototype space to the assembly space. A viewing direction D is set, which indicates the direction in which the designer wants to view it when the assembly 40 of component instances 41 is rendered as a two-dimensional image. The two-dimensional image plane p is provided with a viewport 42, which in this example is a rectangle with two opposing long sides 43d, 43b and two opposing short sides 43c, 43a. A set of points of viewport planes 44a, 44b, 44c, 44d are defined to be parameterized so that each viewport plane 44a, 44b, 44c, 44d extends from the associated side 43a, 43b, 43c, 43d of the viewport 42. However, with Figure 2The example shown in FIG. 4 is different from that in order to render the assembly 40 of the component instance 41 in a parallel manner, there is no eye point, and the set of viewport planes 44a, 44b, 44c, 44d forms a cuboid with infinite length instead of being connected at the viewpoint. Similarly, the viewport 42 and the viewport planes 44a, 44b, 44c, 44d are each defined in its own prototype space, which is independent of the prototype space of the component instance 41. The viewport 43 and the set of viewport planes 44a-44d are associated with a transformation from the viewport prototype space to the assembly space. A point 45 in the middle of the plane 44a is selected for parameterization. However, in other examples, the point 45 can be located anywhere in the viewport plane 44a, not necessarily the center. In one example, each transformation is defined in double precision, so it is necessary to convert to quad precision when generating the combined transformation, which will be described below. Alternatively, the transformation is defined in quad precision, and can therefore be combined without any modification. As described further below, there is no limit to the precision with which the scaling and / or translation transforms may be defined prior to generating the combined transform.
[0037] Figure 5 is based on Figure 4 A second schematic diagram of the assembly of component instances rendered in a parallel manner as a two-dimensional image. Figure 5 A situation is shown where the assembly 40 of a component instance 41 is positioned at a large distance from a point 45 of a parameterized viewport plane 44a. The viewport plane 44a and point 45 are within the system operating region, but the assembly 40 of the component instance 41 is outside the system operating region. Point 45 within the viewport plane 44a and the surface normal vector N defining the viewport plane 44a and the parameterization are shown. If the visibility calculation is made at this point using only the appropriate transformation defined in double precision, it is incorrect. For example, a small feature of the component instance that is close to one of the edges of the viewport 42 may end up being incorrectly clipped or determined to be on the wrong side of the viewport plane 44a. However, by generating a combined transformation with quad precision when operating on point 45 on the viewport plane 44a, even if the parameterization of the viewport plane 44a is defined in double precision, the point 45 parameterizing the viewport plane 44a and the component instance 41 being rendered are both within the operating region. In this example, the viewing direction D is parallel to the surface normal N of the two-dimensional image plane. However, it should be understood that the viewing direction D may be at an angle α to the surface normal N of the two-dimensional image plane, wherein the angle α relative to the surface normal N is < 90°.
[0038] Figure 66 is a flow chart illustrating a method according to an embodiment of the present disclosure. A computer-implemented method 600 renders a two-dimensional image of an assembly of component instances in a three-dimensional assembly space within a computer-aided design (CAD) system. Such a CAD system utilizes double precision to describe the component assembly, wherein each component instance in the assembly 20, 40 is associated with its own prototype space and a transformation that transforms the component instance 21, 41 from its prototype space to the assembly space.
[0039] In step 602, a definition of a two-dimensional image plane p (in which the two-dimensional rendered image is viewed) and a viewpoint 22 (from which the two-dimensional rendered image is viewed) or viewing direction D is received; and a definition of a viewport 23, 42 located in the two-dimensional image plane p is received, the viewport representing the desired portion of the two-dimensional image plane that the designer wishes to view. These definitions may be received from a designer input device and entered by the designer when the designer wishes to render a two-dimensional image, or may be received from elsewhere within the CAD system. As an example, the designer preferences may be stored in an associated memory and retrieved when the designer clicks on an icon or menu provided on a display device associated with the CAD system. Alternatively, these definitions may be set as system preferences or provided via an API linked to a separate software program.
[0040] At step 604, the method proceeds to define a parameterization of a set of viewport planes 25a-25d, 44a-44d in the viewport prototype space, the set of viewport planes extending from the viewport 23, 42 to the viewpoint 22 or parallel to the viewing direction D to create a three-dimensional shape by selecting points in each viewport plane 25a-25d, 44a-44d. The viewport 23, 42 planes 25a-25d, 44a-44d are associated with a transformation from the viewport prototype space to the assembly space.
[0041] At step 606, a combined transformation is generated in quad precision. The combined transformation includes transformations associated with component instances 21, 41 in assemblies 20, 40; transformations associated with viewports 23, 42 and the set of viewport planes 25a-25d, 44a-44d; and transformations that scale and / or translate the viewports 23, 42 and the set of viewport planes 25a-25d, 44a-44d. When the designer requires viewing in perspective, a transformation that scales the viewport 23 and the set of viewport planes 25a-25d is used, as this provides a perspective element related to the size of any feature of the component instance 21. Depending on the distance between the viewport 23 and the assembly 20 of the component instance 21, it may also be necessary to include a transformation that translates the viewport 23. When the designer requires viewing in parallel, a transformation that translates the viewport 42 and the set of viewport planes 44a-44d is used, as this preserves the original size of any feature of the component instance 21. As previously described, each partial transform may be provided in quad precision format or may be upgraded to quad precision format in order to generate a combined transform that would otherwise be provided or stored in double precision. This upgrade process is described in more detail below.
[0042] Figure 7a is a schematic diagram of the scaling transformation function in perspective rendering. The viewpoint is formed by the eyepoint E, which is transformed into the assembly space and fixed. The line L from the eyepoint E to the viewport plane V intersects the viewport plane V at point R. The component instance origin P is projected onto the line L to obtain point Q, forming the apparent position of the component instance origin P when viewed in perspective. The transformation is composed of a scaling factor S of
[0043] It can be described by the scaling transformation.
[0044] Figure 7b is a schematic diagram of the translation transformation function in parallel rendering. Line L extends parallel to the viewing direction D from point R representing the viewport origin transformed to assembly space. The component instance origin P is projected onto line L to obtain point Q, forming the apparent position of the component instance origin P when viewed in a parallel manner. The transformation is given by the translation vector T
[0045] T =Q-R translation transformation description. Since the purpose of both the scale and translation transformations is to move the component instance origin P from a relatively large distance from the viewport to another location, the accuracy of the transformation itself is not critical. This means that it can be provided in single, double, or quad precision, depending on the designer and the origin of the transformation within the design workflow. If it is not provided in quad precision, an upgrade process that can generate a combined transformation is required.
[0046] In the examples given above, the viewpoint was chosen to be the eyepoint in the perspective rendering, and is therefore in a fixed position. However, depending on the purpose of the rendering, the designer may need to place the viewpoint at a position independent of the eyepoint, for example at a distance in order to understand what a second observer would experience from the same perspective rendering. In this case, a scaling transform S and a translation transform t are needed. T Both are used to generate combined transformations.
[0047] Once the combined transform is generated in quad precision, step 608 can be performed. In step 608, the combined transform and the points defining the viewport planes 25a-25d, 44a-44d in double precision are operated on to intersect the faces and / or edges of at least one component instance 21, 41 in the assembly 20, 40 with at least one of the viewport planes 25a-25d, 44a-44d to generate clipping lines and / or clipping points. The intersection calculations themselves are performed in double precision, in other words, quad precision is only used when generating the combined transform. The clipping lines and clipping points clip the faces and edges of the component instances in the assembly to the portion of the assembly that is within the viewport.
[0048] At step 610, a rendering of a two-dimensional image of the assembly 20, 40 of the part instance 21, 41 is output. The clipping lines and / or clipping points are used to restrict the rendering to the portion of the assembly 20, 40 that is within the viewport 23, 42. A face of a part instance 21, 41 in the assembly 20, 40 may contain a feature of interest. If this is the case, the method 600 is used so that the imaging calculations required to render the feature are correct even if it is located on the boundary of the viewport 23, 42.
[0049] Although the transforms that make up the combined transform can be provided in quad precision, in order to keep any associated computational costs to a minimum, it is desirable for the CAD system to always use double precision, which means that these transforms need to be upgraded to quad precision to generate the combined transform. The transforms themselves are represented as matrices within the CAD system. For transforms that include a translation matrix, the translation matrix is in 3×3 matrix format. This requires extending the double precision representation of the translation matrix to quad precision. This can be done in one of a number of ways, including extending the number of significant digits by adding zeros, similar to zero padding.
[0050] If the transformation is a rotation matrix, the transformation must be built to a higher precision using the axis-angle information. In this case, the capture of the axes and angles can be done directly from the information entered by the designer. However, the axis-angle information may not be available directly from the designer's input. The upgrade actually requires reverse engineering the designer's intent to enter the 3×3 rotation matrix in double precision and accurately represent it in quad precision. When upgrading, instead of simply converting the rotation matrix from double precision to quad precision, the axis-angle formula is used to determine the original rotation parameters. The axis-angle representation of the rotation matrix is determined to obtain the rotation angle θ in degrees and the rotation axis A, both in quad precision. This can be done using Rodrigues' Formula, where, for rotation angles θ outside the range of 175° to 185°, the conversion includes solving
[0051] R=I+(sinθ)K+(1-cosθ)K 2 ,
[0052] Where R is the rotation matrix for the rotation angle θ about axis k, I is the identity matrix, and K is the cross product matrix for axis k.
[0053] For angles in the range of 175° to 185°, the transformation consists of diagonalizing the rotation matrix to generate an eigenvector with a value of 1. This is because at angles near singularities (sinθ=0), dividing by sinθ will result in extremely large numbers. It was empirically determined to be 180°±5° by executing multiple test cases. In addition, near 0° and 180°, the value of cosθ calculated from the 3×3 rotation matrix is also unstable, and therefore arctan2 is used as an alternative to arccos when solving for R.
[0054] Once the axis-angle conversion is complete, the rotation angle θ of the axis-angle representation is snapped to quadruple precision, and if necessary, the rotation axis A of the axis-angle representation is snapped to an axis normalized to quadruple precision. Angle snapping involves calculating the rotation angle θ as an integer fraction of a circle, which when expressed in degrees corresponds to any fraction a / b, where a is an integer and b is an unsigned integer less than or equal to 100°. This utilizes the Farey's sequence to determine the original angle θ of the rotation parameter. Expressing the rotation angle θ as a fraction of a circle in quadruple precision is more accurate than doing so in double precision or simply extending double precision to quadruple precision. By limiting the value of the denominator to 100° and using multiple angles for any rotation with b>100°, the same method is allowed to be successfully used for quadrilaterals and other regular polygons. Axis snapping takes into account twenty-six real-world axes, but in order not to increase computational cost, the rotation axis A is not iterated over all twenty-six axes, but it is iterated over a set of absolute value axes normalized to quadruple precision to determine the absolute axis that is most suitable for snapping. After an absolute value axis is selected, the real axis is found by determining the absolute value of the position of the component relative to its local space or its origin and determining the sign required to convert the absolute value to a real value. The axes can include the world axis and its diagonal.
[0055] The transformation is again a combination of rotation and reflection, if the number of reflections is even, then the transformation is a true (proper) rotation matrix and can be converted to a rotation, and if the number of reflections is odd, then the transformation is a false (improper) rotation matrix and can be converted to a reflection with a non-zero rotation angle. Similar to when considering the rotation matrix, the designer enters the 3×3 reflection matrix in double precision. The difference between the rotation matrix and the reflection matrix is that the rotation matrix has a positive determinant, while the reflection matrix has a negative determinant. Therefore, in order to start the conversion process for the reflection matrix, the reflection matrix is multiplied by the negative identity matrix -I to obtain the rotation matrix, and the axis-angle conversion is continued as described above before the resulting matrix is finally multiplied by the negative identity matrix -I again. Therefore, this converts the false matrix into a true matrix in order to perform axis snapping and restore the resulting matrix to the original false state. The negative identity matrix -I is a false rotation of 180°, where the rotation axis is arbitrary. The axis-angle representation of the matrix is determined to obtain the zero rotation angle θ and the rotation axis A of quadruple precision, and the rotation axis A of the axis-angle representation is snapped to the axis normalized with quadruple precision. The rotation angle θ is 0°, so there is no need to perform the angle snapping step.
[0056] Quad-precision versions of the sine and cosine functions can also be implemented to improve the accuracy of the calculations. Using a principle similar to iterating on the seven absolute value axes, the angle is pulled into the range of [0,π / 2] based on other quadrants being equal to this quadrant or being the negative of this quadrant. The Taylor series of sine or cosine is then calculated using the identity sin(x)=cos(π / 2-x) to obtain a Taylor series with a small parameter. For example, for sin(1.5), instead of calculating the Taylor series of the sine function of 1.5, calculating the Taylor series of the cosine function of π / 2-1.5 will achieve faster convergence. This also enables the Taylor series coefficients to be calculated and hard-coded in the program code, rather than calculated on the fly at runtime.
[0057] Figure 8 An example of a data processing system in which an embodiment of the present disclosure can be implemented is shown, such as a CAD system configured to perform processing as described herein. A data processing system 70 includes a processor 71 connected to a local system bus 72. The local system bus connects the processor to a main memory 73 and a graphics display adapter 74, which can be connected to a display 75. The data processing system can communicate with other systems via a wireless user interface adapter connected to the local system bus 72 or via a wired network such as a local area network. Additional memory 76 can also be connected via the local system bus. Suitable adapters (such as a wireless user interface adapter 77) for other peripherals (such as a keyboard 78 and a mouse 79 or other pointer devices) allow users to provide input to the data processing system. Other peripherals may include one or more I / O controllers, such as a USB controller, a Bluetooth controller and / or a dedicated audio controller (connected to a speaker and / or a microphone). It is also understood that various peripheral devices can be connected to the USB controller (via various USB ports), including input devices (e.g., keyboards, mice, touch screens, trackballs, cameras, microphones, scanners), output devices (e.g., printers, speakers), or any other type of device operable to provide input or receive output from a data processing system. It is also understood that many devices referred to as input devices or output devices can both provide input and receive output in communication with a data processing system. It is also understood that other peripheral hardware connected to the I / O controller can include any type of device, machine, or component configured to communicate with a data processing system.
[0058] An operating system included in the data processing system enables output from the system to be displayed to a user on display 75 and enables the user to interact with the system. Examples of operating systems that may be used in a data processing system may include Microsoft Windows TM 、Linux TM,UNIX TM 、iOS TM and Android TM operating system.
[0059] It is further understood that the data processing system 70 can be implemented as a networked environment, a distributed system environment, a virtual machine in a virtual machine architecture, and / or a cloud environment. For example, the processor 71 and associated components can correspond to a virtual machine executed in a virtual machine environment of one or more servers. Examples of virtual machine architectures include VMware ESCi, Microsoft Hyper-v, Xen, and KVM.
[0060] It will be appreciated by those of ordinary skill in the art that the hardware described for the data processing system 70 may vary for a specific implementation. For example, the data processing system 70 in this example may correspond to a computer, a workstation, and / or a server. However, it will be appreciated that alternative embodiments of the data processing system may be configured with corresponding or alternative components, such as in the form of a mobile phone, a tablet computer, a controller board, or any other system that is operable to process data and perform the functions and features described herein associated with the operation of the data processing system, computer, processor, and / or controller discussed herein. The examples presented are provided for illustrative purposes only and are not meant to imply architectural limitations regarding the present disclosure.
[0061] The data processing system 70 may be connected to a network (not part of the data processing system 70), which may be any public or self-use data processing system network or combination of networks known to those skilled in the art, including the Internet. The data processing system 70 may communicate with one or more other data processing systems, such as a server (also not part of the data processing system 70), via a network. However, alternative data processing systems may correspond to multiple data processing systems implemented as part of a distributed system, wherein processors associated with several data processing systems may be in communication with the aid of one or more network connections, and tasks described as being performed by a single data processing system may be collectively performed. Therefore, it should be understood that when referring to the data processing system 70, such a system may be implemented across several data processing systems, which are organized in a distributed system that communicates with each other via a network. Therefore, embodiments of the present disclosure may be implemented in a distributed computing network, such as a cloud computing environment.
[0062] Therefore, the embodiments described above in the present disclosure solve the problem of dealing with the limitations of the effective volume of assemblies defined in double precision in CAD systems when rendering two-dimensional images using viewports in a localized manner suitable for use in large, complex existing software systems. By using quad precision only when necessary, the impact of higher precision transformations on performance and memory requirements is significantly reduced. This is because calculations performed in quad precision generally have worse performance than calculations performed in double precision due to the lack of inherent support and doubled memory requirements. Since any code not related to combined transformations (including intersection calculations of clipping lines and clipping points) can continue to work in double precision, there is no adverse impact on the overall performance of the system or the designer's experience.
Claims
1. A computer-implemented method for rendering a two-dimensional image of an assembly of component instances in a three-dimensional assembly space to a designer in a computer-aided design (CAD) system that uses double precision to describe the assembly of components, in, Each of the component instances in the assembly is associated with a prototype space and a transformation that transforms the corresponding component instance from the prototype space of the corresponding component instance to the three-dimensional assembly space, the method comprising: receiving a definition of a two-dimensional image plane in which to view a two-dimensional rendered image and a viewpoint or viewing direction from which to view the two-dimensional rendered image; and also receiving a viewport located in the two-dimensional image plane and representing a desired portion of the two-dimensional image plane that a designer wishes to view; defining a parameterization of a set of viewport planes in a viewport prototype space by selecting points in each of a set of viewport planes to create a three-dimensional shape, the viewport planes extending from the viewport toward the viewpoint or parallel to the viewing direction, the viewport and the set of viewport planes being associated with a transformation from the viewport prototype space to the three-dimensional assembly space; Generate a combined transform in quad precision, the combined transform comprising: a transformation associated with the component instance in the assembly; a transformation associated with the viewport and the set of viewport planes; and a transformation that scales and / or translates the viewport with respect to the set of viewport planes; operating the combined transformation and the points defining the viewport plane in double precision to intersect faces and / or edges of at least one component instance in the assembly with at least one of the viewport planes to generate clipping lines and / or clipping points that clip the faces and edges of the component instances in the assembly to a portion of the assembly that is within the viewport; and A rendering of a two-dimensional image of the assembly of the component instance is output, wherein the clipping lines and / or clipping points are used to restrict the rendering to a portion of the assembly that is within the viewport.
2. The method according to claim 1, in, Transformations associated with the component instances in the assembly and transformations associated with the viewport and the set of viewport planes are provided in quad precision.
3. The method according to claim 1, in, Transformations associated with the component instances in the assembly and transformations associated with the viewport and the set of viewport planes are upgraded to quad precision.
4. The method according to claim 1, in, rendering the two-dimensional image as a perspective view, wherein an eyepoint defining a position of an observer at said viewpoint is also received, and Therein, the three-dimensional shape is a pyramid having the viewport at its base and the eyepoint at its vertex.
5. The method according to claim 4, in, The combined transformation includes: a transformation associated with the component instance in the assembly; a transformation associated with the viewport and the set of viewport planes; and a transformation that scales the viewport and the set of viewport planes.
6. The method according to claim 1, in, rendering the two-dimensional image as a parallel view, and The three-dimensional shape is a prism with the viewport as the base.
7. The method according to claim 6, in, rendering the two-dimensional image as a parallel view, and The three-dimensional shape is a cuboid with the viewport as the base.
8. The method according to claim 7, in, The combined transformation includes: a transformation associated with the component instance in the assembly; a transformation associated with the viewport and the viewport plane; and a transformation that translates the viewport and the set of viewport planes.
9. The method according to claim 6, in, The combined transformation includes: a transformation associated with the component instance in the assembly; a transformation associated with the viewport and the viewport planes; and a transformation that translates the viewport and the set of viewport planes.
10. The method according to claim 1, in, The viewing direction is parallel to a surface normal of the two-dimensional image plane.
11. The method according to claim 1, in, The effective volume of the three-dimensional assembly space and the parameterized points defining the viewport plane are confined to the system operating area, and Wherein at least one of the component instances in the assembly is located outside the system operating area.
12. The method according to claim 1, in, One of the faces of the component instance in the assembly that is clipped to the viewport contains a feature of interest.
13. The method according to claim 1, in, Quad precision is employed only when generating the combined transform.
14. Computer program comprising instructions which, when executed on a computer, cause the computer to perform the steps of any one of claims 1 to 13.
15. A data processing system adapted to render to a designer within a computer aided design (CAD) system that uses double precision to describe the assembly of components a two-dimensional image of an assembly of component instances in a three-dimensional assembly space, in, Each of the component instances in the assembly is associated with a prototype space and a transformation that transforms the corresponding component instance from the prototype space of the corresponding component instance to the three-dimensional assembly space, the data processing system comprising: a designer input device adapted to receive a definition of a two-dimensional image plane in which to view a two-dimensional rendered image and a viewpoint or viewing direction from which to view the two-dimensional rendered image, and also receive a viewport located in the two-dimensional image plane and representing a desired portion of the two-dimensional image plane that a designer wishes to view; a data processor adapted to define a parameterization of a set of viewport planes in a viewport prototype space by selecting points in each of a set of viewport planes to create a three-dimensional shape, the viewport planes extending from the viewport to the viewpoint, and the viewport and the set of viewport planes being associated with a transformation from the viewport prototype space to the three-dimensional assembly space; generating a combined transformation in quad precision, the combined transformation comprising: a transformation associated with the component instance in the assembly; a transformation associated with the viewport and the set of viewport planes; and a transformation that scales and / or translates the viewport with the set of viewport planes; operating on the combined transformation and the points defining the viewport planes in double precision to intersect a face and / or edge of at least one component instance in the assembly with at least one of the viewport planes to generate clipping lines and / or clipping points that clip the face and the edge of the component instance in the assembly to a portion of the assembly that is within the viewport; and A graphics system is provided, the graphics system being adapted to output a rendering of a two-dimensional image of the assembly of the component instances, wherein the clipping lines and / or clipping points are used to restrict the rendering to a portion of the assembly that is within the viewport.
16. The data processing system according to claim 15, in, The data processor is further adapted to be capable of using quadruple precision only when generating the combined transform.
