Three-dimensional model cutting method and device
By receiving the bounding box vertex coordinates and spatial transformation matrix input by the user, a target bitmap is generated, and it is determined whether the pixels in the 3D model are located within the bounding box. This solves the problem of low efficiency in cuboid box clipping and achieves efficient 3D model clipping.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, when rendering 3D models based on WebGL, the culling efficiency of cuboid boxes is low, which cannot meet user needs and has low culling efficiency.
By receiving the vertex coordinate set and spatial transformation matrix of the bounding box input by the user, the initial bitmap is determined, and the target bitmap is generated through encoding processing. The system then determines whether the pixels in the model to be cropped are located within the bounding box, thus achieving fast cropping.
It improves the efficiency of 3D model clipping by representing multiple bounding boxes with the target bitmap and quickly identifying pixels by combining the box height values, thus achieving efficient clipping judgment.
Smart Images

Figure CN121837562A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to Internet technology, and in particular to a method and apparatus for cropping a three-dimensional model. Background Technology
[0002] When rendering 3D models in a browser using WebGL (Web Graphics Library), sometimes the model itself is irregular and needs to be clipped before rendering. Users need to use tools to select the clipping region. The most common method is to use a cuboid box to select the clipping region. When clipping the model, if a pixel of the model is determined to be within the box area, that pixel is clipped / deleted. However, the cuboid box cannot meet all user needs, and the clipping efficiency is low. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure is proposed. Embodiments of this disclosure provide a method and apparatus for trimming three-dimensional models.
[0004] According to one aspect of the present disclosure, a method for cropping a three-dimensional model is provided, comprising: Receive user input of at least one set of coordinates of at least one bottom vertex of at least one bounding box and at least one box height value, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; Based on the at least one vertex coordinate set and the at least one spatial transformation matrix, at least one initial bitmap is determined; The at least one initial bitmap is encoded to obtain the target bitmap; Based on the target bitmap and the at least one box height value, determine whether at least one pixel in the model to be cropped is located in the at least one bounding box, and obtain at least one judgment result; The model to be clipped is clipped based on at least one of the judgment results.
[0005] Optionally, encoding the at least one initial bitmap to obtain the target bitmap includes: Create a preset bitmap for four-channel representation; each of the four channels represents the value in the channel using a binary number of preset bits; The at least one initial bitmap is encoded into at least one binary block; each binary block corresponds to one initial bitmap; each binary block includes multiple identical binary numbers; The at least one binary block is written into the preset bitmap to obtain the target bitmap.
[0006] Optionally, writing the at least one binary block into the preset bitmap to obtain the target bitmap includes: At least one write location corresponding to the at least one binary block is determined based on the at least one spatial transformation matrix; According to the at least one write position, the at least one initial bitmap is encoded into the at least one binary block by bitmask encoding.
[0007] Optionally, determining whether at least one pixel in the model to be cropped is located within the at least one bounding box based on the target bitmap and the at least one box height value, and obtaining at least one judgment result, includes: For each pixel in the model to be cropped, the pixel is transformed into at least one local coordinate system corresponding to the at least one bounding box to obtain at least one local coordinate value and pixel height value; Based on the at least one local pixel value and the target bitmap, as well as the pixel height value and the at least one box height value, a determination result is made as to whether the pixel is located within the at least one bounding box.
[0008] Optionally, the step of transforming the pixels in the model to be cropped to at least one local coordinate system corresponding to the at least one bounding box, to obtain at least one local coordinate value and pixel height value, includes: The pixel is transformed to the at least one local coordinate system according to the at least one spatial transformation matrix, so as to obtain at least one transformed coordinate of the pixel in the at least one local coordinate system; The at least one local coordinate value and the pixel height value are determined based on the coordinate values of the at least one transformed coordinate in the xz plane of the at least one local coordinate system.
[0009] Optionally, the determination of whether the pixel is located within the at least one bounding box based on the at least one local coordinate value and the target bitmap, as well as the pixel height value and the at least one box height value, includes: Based on the at least one local coordinate value and the target bitmap, determine whether the pixel is within the bottom polygon of the bounding box; In response to the pixel being located within the bottom polygon of the bounding box, the determination result is determined based on the pixel height value and the at least one box height value.
[0010] Optionally, determining whether the pixel point is within the bottom polygon of the bounding box based on the at least one local coordinate value and the target bitmap includes: Normalize the at least one local coordinate value to obtain normalized coordinate values; Based on the normalized coordinate values, the corresponding target binary value is determined in the target bitmap; Determine whether the pixel is within the bottom polygon of the at least one bounding box based on the target binary value.
[0011] Optionally, determining the judgment result based on the pixel height value and the at least one box height value includes: Based on the correspondence between the pixel and the bounding box, the target height value corresponding to the pixel is determined from the at least one box height value; Determine whether the pixel height value is greater than or equal to zero, and less than or equal to the target height value; In response to the pixel height value being greater than or equal to zero and less than or equal to the target height value, a determination result is made that the pixel is within the bounding box.
[0012] Optionally, determining at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix includes: For each of the at least one bounding boxes, a local coordinate system corresponding to the bounding box is determined based on multiple vertex coordinates included in the vertex coordinate set and the spatial transformation matrix; In the local coordinate system, the initial bitmap is determined based on the bottom polygon of the bounding box.
[0013] Optionally, determining the initial bitmap based on the bottom polygon of the bounding box in the local coordinate system includes: Projecting the bounding box onto the xz plane of the local coordinate system yields the bottom polygon of the bounding box; The bottom polygon is normalized in the local coordinate system to obtain the initial bitmap.
[0014] Optionally, before determining whether at least one pixel in the model to be cropped is located within the at least one bounding box based on the target bitmap and the at least one box height value, and obtaining the determination result, the method further includes: The resolution coefficient is determined based on the actual scene scale and reference unit length corresponding to the model to be clipped; The size of the target canvas for displaying the model to be cropped is determined based on the resolution coefficient.
[0015] Optionally, the step of cropping the model to be cropped based on the at least one judgment result includes: Render the model to be clipped onto the target canvas; In the target canvas, at least one pixel in the model to be cropped is cropped according to the at least one judgment result.
[0016] According to another aspect of the embodiments of this disclosure, a three-dimensional model trimming device is provided, comprising: The data receiving module is used to receive at least one set of coordinates of the bottom face vertices of at least one bounding box and at least one box height value input by the user, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; A transformation processing module is used to determine at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix; A bitmap encoding module is used to encode the at least one initial bitmap to obtain a target bitmap; The pixel determination module is used to determine whether at least one pixel in the model to be cropped is located in the at least one bounding box based on the target bitmap and the at least one box height value, and to obtain at least one determination result; The model trimming module is used to trim the model to be trimmed based on the at least one judgment result.
[0017] Optionally, the bitmap encoding module is specifically used to create a preset bitmap with four channels; each of the four channels represents the value in the channel through a binary number of preset bits; the at least one initial bitmap is encoded into at least one binary block; each binary block corresponds to one initial bitmap; each binary block includes multiple identical binary numbers; the at least one binary block is written into the preset bitmap to obtain the target bitmap.
[0018] Optionally, when the bitmap encoding module writes the at least one binary block into the preset bitmap to obtain the target bitmap, it is used to determine at least one write position corresponding to the at least one binary block based on the at least one spatial transformation matrix; and to encode the at least one initial bitmap into the at least one binary block by bitmask encoding according to the at least one write position.
[0019] Optionally, the pixel determination module includes: The coordinate transformation unit is used to transform each pixel in the model to be cropped to at least one local coordinate system corresponding to the at least one bounding box, so as to obtain at least one local coordinate value and pixel height value. The judgment unit is used to determine whether the pixel is located in the at least one bounding box based on the at least one local pixel value and the target bitmap, as well as the pixel height value and the at least one box height value.
[0020] Optionally, the coordinate transformation unit is specifically used to transform the pixel points to the at least one local coordinate system according to the at least one spatial transformation matrix, so as to obtain at least one transformed coordinate of the pixel points in the at least one local coordinate system; and to determine the at least one local coordinate value and the pixel height value according to the coordinate values of the at least one transformed coordinate in the xz plane in the at least one local coordinate system.
[0021] Optionally, the determining unit is specifically configured to determine whether the pixel is within the bottom polygon of the bounding box based on the at least one local coordinate value and the target bitmap; and in response to the pixel being within the bottom polygon of the bounding box, to determine the determining result based on the pixel height value and the at least one box height value.
[0022] Optionally, when determining whether a pixel is within the bottom polygon of the bounding box based on the at least one local coordinate value and the target bitmap, the determining unit performs normalization on the at least one local coordinate value to obtain a normalized coordinate value; determines the corresponding target binary value in the target bitmap based on the normalized coordinate value; and determines whether the pixel is within the bottom polygon of the at least one bounding box based on the target binary value.
[0023] Optionally, when determining the determination result based on the pixel height value and the at least one box height value, the determination unit is configured to determine the target height value corresponding to the pixel from the at least one box height value according to the correspondence between the pixel and the bounding box; determine whether the pixel height value is greater than or equal to zero and less than or equal to the target height value; and determine the determination result of the pixel in the bounding box in response to the pixel height value being greater than or equal to zero and less than or equal to the target height value.
[0024] Optionally, the transformation processing module is specifically used to determine the local coordinate system corresponding to each of the at least one bounding boxes based on multiple vertex coordinates included in the vertex coordinate set and the spatial transformation matrix; and to determine the initial bitmap based on the bottom polygon of the bounding box in the local coordinate system.
[0025] Optionally, when the transformation processing module determines the initial bitmap based on the bottom polygon of the bounding box in the local coordinate system, it projects the bounding box onto the xz plane of the local coordinate system to obtain the bottom polygon of the bounding box; and performs normalization processing on the bottom polygon in the local coordinate system to obtain the initial bitmap.
[0026] Optionally, the device further includes: The canvas size determination module is used to determine the resolution coefficient based on the actual scene scale and reference unit length corresponding to the model to be cropped; and to determine the size of the target canvas for displaying the model to be cropped based on the resolution coefficient.
[0027] Optionally, the model cropping module is specifically used to render the model to be cropped onto a target canvas; and to crop at least one pixel in the model to be cropped in the target canvas according to the at least one judgment result.
[0028] According to another aspect of the present disclosure, an electronic device is provided, comprising: Memory, used to store computer program products; A processor is configured to execute a computer program product stored in the memory, and when the computer program product is executed, to implement the three-dimensional model trimming method described in any of the above embodiments.
[0029] According to another aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the three-dimensional model trimming method described in any of the above embodiments.
[0030] According to another aspect of the present disclosure, a computer program product is provided, including computer program instructions that, when executed by a processor, implement the three-dimensional model trimming method described in any of the above embodiments.
[0031] The three-dimensional model clipping method and apparatus provided in the above embodiments of this disclosure receive user input of at least one set of bottom vertex coordinates and at least one box height value of at least one bounding box, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; determine at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix; encode the at least one initial bitmap to obtain a target bitmap; determine whether at least one pixel in the model to be clipped is located in the at least one bounding box based on the target bitmap and the at least one box height value, and obtain at least one judgment result; clip the model to be clipped according to the at least one judgment result; the embodiments of this disclosure represent the initial bitmaps corresponding to multiple bounding boxes through the target bitmap, and identify the pixels in the model to be clipped based on the target bitmap combined with the box height value of the bounding box, thereby achieving fast clipping judgment and improving the efficiency of model clipping.
[0032] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0033] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0034] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein: Figure 1 This is a flowchart illustrating a three-dimensional model trimming method provided in an exemplary embodiment of this disclosure; Figure 2 This is a public announcement Figure 1 A flowchart illustrating step 104 in the illustrated embodiment; Figure 3 This is a public announcement Figure 1 A flowchart illustrating step 106 in the illustrated embodiment; Figure 4 This is a public announcement Figure 1 A flowchart illustrating step 108 in the illustrated embodiment; Figure 5 This is a schematic diagram of the structure of a three-dimensional model trimming device provided in an exemplary embodiment of the present disclosure; Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0035] Hereinafter, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present disclosure, and not all embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0036] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0037] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0038] It should also be understood that in the embodiments disclosed herein, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.
[0039] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.
[0040] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship. The data referred to in this disclosure can include unstructured data such as text, images, and videos, as well as structured data.
[0041] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0042] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0043] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0044] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0045] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0046] The embodiments disclosed herein can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.
[0047] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0048] Application Overview In developing this disclosure, the inventors discovered that in the prior art, the determination of whether a pixel is inside a cuboid box is achieved through mathematical judgment of whether the pixel on the model is inside the cuboid box, thereby completing the cropping. However, this judgment is very inefficient, resulting in low cropping efficiency, and the efficiency further decreases if multiple cuboid boxes exist.
[0049] The mathematical judgment method for this model includes: projecting the pixels and the cuboid box in the model onto a plane, drawing a ray from the projected point of the pixel, and if the number of intersections between this ray and the rectangle corresponding to the cuboid box is even, then the point is located outside the rectangle. This is because when a ray enters the rectangle from the outside, it must enter and exit, thus ensuring an even number of intersections.
[0050] Exemplary methods Figure 1 This is a flowchart illustrating a three-dimensional model trimming method provided in an exemplary embodiment of this disclosure. This embodiment can be applied to electronic devices, such as... Figure 1 As shown, it includes the following steps: Step 102: Receive at least one set of bottom vertex coordinates and at least one box height value of at least one bounding box input by the user, as well as at least one spatial transformation matrix corresponding to at least one bounding box.
[0051] The bottom vertex coordinate set includes multiple vertices of the polygon corresponding to the bottom face of the bounding box. The shape and height of a bounding box can be determined based on a bottom vertex coordinate set and a box height value.
[0052] Optionally, the user-inputted set of at least one bottom vertex coordinates and at least one box height value of at least one bounding box, as well as at least one spatial transformation matrix corresponding to at least one bounding box, can correspond to a clipping instruction, or each bounding box can correspond to a clipping instruction. The user's clipping instruction can be received first, followed by the set of bottom vertex coordinates and box height value of the bounding box corresponding to the clipping instruction, and the spatial transformation matrix.
[0053] Optionally, each bounding box corresponds to a set of bottom vertex coordinates and a box height value. For example, the user wants to clip the model to be clipped using at least one bounding box of a different shape; or, at least one bounding box corresponds to a set of bottom vertex coordinates and a box height value, and the user wants to clip the model to be clipped using bounding boxes of the same shape.
[0054] In addition, the location to be clipped in the model is determined by the user input. This corresponds to the spatial transformation matrix of the bounding box. Each bounding box has a spatial transformation matrix. By using this spatial transformation matrix, the translation and rotation of the bounding box in the world coordinate system can be determined, thus determining the position of the bounding box in the model to be clipped.
[0055] Among them, the spatial transformation matrix is a core tool in computer graphics and robotics. The spatial transformation matrix is a matrix that represents the translation, rotation, and scaling of a point, vector, or model in space (in this embodiment, since the size is configured by the user, scaling is usually not involved). The transformed result can be quickly calculated through matrix multiplication. In three-dimensional space, it is usually represented as a 4x4 matrix.
[0056] Step 104: Determine at least one initial bitmap based on at least one vertex coordinate set and at least one spatial transformation matrix.
[0057] In one embodiment, for each bounding box, a local coordinate system can be constructed based on the vertex coordinate set and the spatial transformation matrix, with the bottom polygon of the bounding box as one plane (e.g., the xz plane), and the height of the bounding box corresponding to another coordinate axis of the local coordinate system (e.g., the y-axis). At this point, a two-dimensional initial bitmap can be determined based on the bottom polygon. For example, the bottom polygon can be normalized and drawn using a canvas to generate a corresponding Canvas image. Optionally, after obtaining the initial bitmap, the interior of the polygon corresponding to the initial bitmap can be set to the same color, while the background outside the polygon can be set to a different color to distinguish between the inside and outside of the polygon. For example, the fill color inside the polygon can be set to black, and the default background color can be white.
[0058] Step 106: Encode at least one initial bitmap to obtain the target bitmap.
[0059] Optionally, a 4-channel bitmap (Canvas) of RGBA (red component, green component, blue component, and transparency component) is created, with a total of 32 bits available, to store the final encoded result. The internal information of at least one initial bitmap is encoded into the corresponding channel through bit operations to obtain the target bitmap.
[0060] Step 108: Based on the target bitmap and at least one box height value, determine whether at least one pixel in the model to be cropped is located in at least one bounding box, and obtain at least one judgment result.
[0061] Each judgment result corresponds to a pixel, and the judgment result includes whether the pixel is within any bounding box or not within any bounding box.
[0062] In this embodiment, the target bitmap represents the bottom polygon corresponding to at least one bounding box. Therefore, based on the target bitmap, it is possible to determine whether a pixel is within the bounding box in the plane corresponding to the bottom polygon. Then, by combining the box height value to determine whether the pixel is within the bounding box in the direction of the vertical plane, the judgment result can be determined.
[0063] Step 110: Cut the model to be cut according to at least one judgment result.
[0064] If the judgment result determines that the corresponding pixel is within any bounding box, the pixel in the model to be cropped can be cropped; if the judgment result determines that the corresponding pixel is not within any bounding box, the pixel is not cropped and the pixel in the model to be cropped is retained.
[0065] The three-dimensional model clipping method provided in the above embodiments of this disclosure receives at least one set of bottom vertex coordinates and at least one box height value of at least one bounding box input by a user, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; determines at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix; encodes the at least one initial bitmap to obtain a target bitmap; determines whether at least one pixel in the model to be clipped is located in the at least one bounding box based on the target bitmap and the at least one box height value, and obtains at least one judgment result; clips the model to be clipped according to the at least one judgment result. The embodiments of this disclosure use a target bitmap to represent the initial bitmaps corresponding to multiple bounding boxes, and identify pixels in the model to be clipped based on the target bitmap combined with the box height values of the bounding boxes, achieving rapid clipping judgment and improving the efficiency of model clipping.
[0066] like Figure 2 As shown above, in the above Figure 1 Based on the illustrated embodiment, for each bounding box in at least one bounding box, step 104 may include the following steps: Step 1041: Determine the local coordinate system corresponding to the bounding box based on the multiple vertex coordinates and spatial transformation matrix included in the vertex coordinate set.
[0067] Optionally, in this embodiment, the local coordinate system takes the center point of the bottom polygon of the bounding box as the origin, the bottom polygon as the xz plane, and the height direction of the bounding box as the y-axis. The process of determining the local coordinate system may include: first, calculating and determining the center point based on the coordinates of multiple vertices to determine the origin of the local coordinate system; determining the y-axis (normal vector) using the cross product of the vectors inside the bottom plane; defining the x-axis based on the edge vectors of the bottom plane; obtaining the z-axis by cross product of y and x, and finally constructing a right-handed orthogonal local coordinate system.
[0068] Step 1042: In the local coordinate system, determine the initial bitmap based on the bottom polygon of the bounding box.
[0069] Optionally, step 1042 may include: Project the bounding box onto the xz plane of the local coordinate system to obtain the bottom polygon of the bounding box; normalize the bottom polygon in the local coordinate system to obtain the initial bitmap.
[0070] Optionally, the normalized base polygon can be drawn using a Canvas to generate a corresponding Canvas image as the initial bitmap.
[0071] In computer graphics and web development, Canvas typically refers to the HTML5 standard. <canvas>An element is a canvas that can dynamically draw graphics, images, text, and even implement interactions and animations via scripts (mainly JavaScript). This embodiment projects the bounding box onto the xz plane and performs normalization processing on the projected polygons, thus confining the bottom polygons of the bounding box to a certain area within the xz plane of the local coordinate system, facilitating subsequent pixel identification in the model to be clipped.
[0072] like Figure 3 As shown above, in the above Figure 1 Based on the illustrated embodiment, step 106 may include the following steps: Step 1061: Create a preset bitmap for four-channel representation.
[0073] In this system, each of the four channels represents the value in the channel using a binary number of a preset number of bits. For example, the four channels are RGBA (red component, green component, blue component, and transparency component), with each channel corresponding to an 8-bit binary number. For instance, the R channel has 8 bits, which is 00000000 in binary. The preset bitmap can be an all-zero bitmap of any size. For example, the size of the preset bitmap is 512×512, where the 32-bit binary number corresponding to each position is 00000000 000000000000000 00000000. By setting the all-zero bitmap, at least one initial bitmap can be encoded into it later, for example, by encoding at least one initial bitmap into the preset bitmap using a mask.
[0074] Step 1062: Encode at least one initial bitmap into at least one binary block.
[0075] Each binary block corresponds to an initial bitmap, and each binary block contains multiple identical binary numbers. Within the same binary block, the same binary number is used. For example, if the user sets a bounding box, the corresponding initial bitmap (canvas image) is read. For points inside the polygons, the least significant bit of the 32-bit binary number is set to 1, resulting in 00000000 00000000 00000000 00000001. Multiple points with the same binary code corresponding to the initial bitmap constitute a binary block. If there are two polygons (corresponding to two initial bitmaps), the second polygon is set using the second-to-last bit of the 32-bit binary number, for example: 00000000 00000000 000000000000010. This way, the 4-channel preset bitmap can store the initial bitmaps corresponding to 32 bounding boxes. The size and shape of each binary block are determined by normalizing the base polygon in the local coordinate system corresponding to the bounding box.
[0076] Step 1063: Write at least one binary block into a preset bitmap to obtain the target bitmap.
[0077] Optionally, after determining the binary block corresponding to each initial bitmap, the target bitmap can be obtained by writing at least one binary block into a preset bitmap. For example, the binary block can be written using a mask. In this case, the target bitmap includes at least one non-zero region, and each non-zero region is identified by the same binary number. Therefore, the target bitmap reflects the positional relationship and coverage of the bottom polygon corresponding to each bounding box in the display area. Optionally, the preset bitmap can be transformed to the local coordinate system corresponding to each initial bitmap using a spatial transformation matrix to obtain the corresponding merged bitmap in different local coordinate systems. Then, all merged bitmaps are overlaid bitwise to obtain the target bitmap. Bitwise overlay can be performed on the binary numbers corresponding to the same position in the preset bitmap. For example, if a position corresponds to the binary numbers 00000001 and 00000010 in the merged bitmaps of two different local coordinate systems, the binary number of that position after merging is 00000011.
[0078] In some alternative embodiments, step 1063 may include: At least one write location corresponding to at least one binary block is determined based on at least one spatial transformation matrix.
[0079] In this embodiment, each bounding box corresponds to a spatial transformation matrix. The spatial transformation matrix includes the translation and rotation information of the bounding box relative to the model to be clipped, which can determine the local coordinate system corresponding to the bounding box. After normalizing the bottom polygon in the local coordinate system, a binary block in the local coordinate system can be obtained. By mapping the preset bitmap to the local coordinate system, the writing position of each binary block in the preset bitmap can be determined.
[0080] At least one initial bitmap is encoded into at least one binary block by bitmasking at at least one write location.
[0081] Bitmask encoding is a technique that uses the states of binary bits (0 / 1) to efficiently store, represent, and manipulate multiple sets of Boolean information or enumerated states. Its core is to use an integer to carry multiple independent states and then use bit operations to read and write them quickly. It is widely used in scenarios such as access control and status marking.
[0082] In this embodiment, after determining the write position of each initial bitmap, bitmask encoding is used to determine which bits in the preset bitmap retain their original encoding and which bits are replaced with the encoding of the initial bitmap based on the write position. Optionally, the initial bitmap can be written to the preset bitmap by performing a bitwise AND operation between the binary number at each position in the initial bitmap and the corresponding binary number in the preset bitmap. Furthermore, when multiple initial bitmaps exist, bitmask encoding can be performed sequentially with the preset bitmap (or a preset bitmap that has already been written to other initial bitmaps). Optionally, if a pixel in the preset bitmap has already been written to... Write the first initial bitmap (e.g., encoded as 00000001), and then write the second initial bitmap (the binary encoding of this initial bitmap is 00000010) to the same pixel. At this point, the binary number of the pixel will be the result of a bitwise AND operation between the binary data of the first initial bitmap and the binary number of the second initial bitmap (e.g., performing a bitwise AND operation between 00000001 and 00000010 yields 00000011). Through the above steps, at least one initial bitmap can be written to a preset bitmap to obtain the encoded target bitmap.
[0083] like Figure 4 As shown above, in the above Figure 1 Based on the illustrated embodiment, for each pixel in the model to be cropped, step 108 may include the following steps: Step 1081: Transform the pixel into at least one local coordinate system corresponding to at least one bounding box to obtain at least one local coordinate value and pixel height value.
[0084] Optionally, for a pixel, the pixel can be transformed to the local coordinate system corresponding to each bounding box in turn, and a judgment can be performed in each local coordinate system. As long as it is determined that the pixel is inside any bounding box (determining to clip the pixel), the subsequent processing of the pixel can be stopped, thereby improving the model clipping efficiency.
[0085] Step 1082: Based on at least one local pixel value and the target bitmap, as well as the pixel height value and at least one box height value, determine the judgment result of whether the pixel is located in at least one bounding box.
[0086] This embodiment determines whether a pixel is within the bounding box's bottom polygon in the local coordinate system's xz plane by using the pixel's local pixel value in the local coordinate system and the target bitmap. When a pixel is within the bounding box's bottom polygon, it determines whether the pixel's height value is greater than or equal to zero and less than or equal to the bounding box's height value to determine whether it is inside the bounding box in the height direction (y-axis of the local coordinate system). Combining the xz plane and the height direction together determines the positional relationship between the pixel and the bounding box, improving the accuracy of the judgment result. Furthermore, using the target bitmap to achieve planar judgment improves the judgment speed.
[0087] In some alternative embodiments, step 1081 may include: The pixels are transformed to at least one local coordinate system according to at least one spatial transformation matrix, so as to obtain at least one transformed coordinate of the pixel in at least one local coordinate system.
[0088] Optionally, the pixels in the model to be clipped are usually in the world coordinate system. The pixels can be transformed to the local coordinate system based on the spatial transformation matrix. For example, the pixels can be transformed to the local coordinate system by multiplying the pixel coordinates by the inverse of the spatial transformation matrix.
[0089] Determine at least one local coordinate value and a pixel height value based on the coordinate values of at least one transformed coordinate in the xz plane of at least one local coordinate system.
[0090] In this embodiment, the 3D matching of pixels and bounding boxes is broken down into matching in two dimensions: the xz plane and the height. Therefore, after determining the transformed coordinates, the 3D coordinates are broken down into the coordinate values corresponding to the xz plane and the pixel height values corresponding to the height, so as to facilitate matching with the bounding boxes and determine whether the pixel is within the bounding box corresponding to the local coordinate system. In this embodiment, the pixel is transformed to the local coordinate system of different bounding boxes for identification, thereby realizing the sequential determination of the relationship between the pixel and each bounding box. Furthermore, the subsequent identification of the pixel can be stopped as long as it is determined that the pixel belongs to any one bounding box.
[0091] In some alternative embodiments, step 1082 may include: Based on at least one local coordinate value and the target bitmap, determine whether a pixel is within the bounding box's bottom polygon.
[0092] Since the target bitmap in this embodiment includes at least one binary block corresponding to at least one bounding box, when performing matching, the corresponding binary number is determined by searching the target bitmap based on the local coordinate value. The binary number is then matched with at least one binary block (including multiple identical binary numbers) to quickly determine whether the pixel is within the bottom polygon range of any one of the bounding boxes.
[0093] Optionally, normalization is performed on at least one local coordinate value to obtain normalized coordinate values; the corresponding target binary number is determined in the target bitmap based on the normalized coordinate values; and whether the pixel is within the bottom polygon of at least one bounding box is determined based on the target binary number.
[0094] In this embodiment, since the bottom polygon of the bounding box is defined in the xz plane of the local coordinate system, with its height corresponding to the y direction, determining whether a pixel is inside the bounding box can be done using the transformed xz coordinates. First, the xz coordinates are normalized to 0-1, and then treated as uv coordinates. Based on these normalized xz coordinate values, the corresponding target binary number (e.g., a 32-bit binary number) can be found at the corresponding position in the target bitmap (a bitmap of a preset size where each position is represented by a 32-bit binary number, where each 32-bit binary number can be understood as corresponding to the channel encoding in the four RGBA channels, for example, each channel in the RGBA channels is encoded using 8-bit binary numbers). The target binary number is read bit by bit. When the target binary number matches the binary data included in any binary block, it means that the pixel is located inside the bottom polygon in the xz plane. For example, since each bit of the target bitmap is 1, corresponding to an initial bitmap, if a bit of the target binary number is read as 1 (e.g., the target binary number is 00000000 00000000), the pixel is considered to be inside the bounding box. 00000000 00000001, while the target bitmap contains a binary block containing multiple binary numbers 00000000 00000000 000000000000001, indicating that the binary number is located within the binary block, indicating that the pixel is inside the bottom polygon.
[0095] In response to a pixel being within the bounding box's bottom polygon, a determination result is made based on the pixel height value and at least one box height value.
[0096] It also includes: in response to the fact that a pixel is not within the bottom polygon of any bounding box, directly determining that the pixel is not located in any bounding box, that is, not performing clipping on the pixel.
[0097] Optionally, the determination result is made based on the pixel height value and at least one box height value, including: Based on the correspondence between pixels and bounding boxes, determine the target height value corresponding to the pixel from at least one box height value; In this embodiment, when it is determined that a pixel belongs to a certain bounding box in the xz plane, the correspondence between the pixel and the bounding box is determined. Based on the correspondence, the height value of the bounding box is obtained as the target height value. By matching the correspondence, the pixel height value only needs to be compared with the target height value that has a corresponding relationship, avoiding the problem of slow speed caused by comparing the pixel height value with each box height value.
[0098] Determine whether the pixel height value is greater than or equal to zero and less than or equal to the target height value.
[0099] Since the bottom polygon of the bounding box in this embodiment is projected onto the xz plane, the minimum value of the bounding box on the y-axis is the origin of the y-axis (where the value is 0). Therefore, the height value determines the range belonging to the bounding box through 0 and the target height value.
[0100] The result of determining whether a pixel is in the bounding box is obtained in response to a pixel height value that is greater than or equal to zero and less than or equal to the target height value.
[0101] It also includes a determination result that the pixel is not within the bounding box in response to a pixel height value being less than zero or greater than the target height value. This embodiment achieves fast and accurate pixel identification by combining the bottom polygon recognition with the height range of the bounding box to determine whether the pixel is within the bounding box.
[0102] Optionally, this embodiment implements pixel recognition in parallel using shaders. The shader is fed an encoded target bitmap, multiple box height values, and the spatial transformation matrix of the bounding box in the world coordinate system. Since the RGBA data in the shader is normalized and its value range is 0-1, it is first converted to binary according to 8-bit encoding, and then the data is read bit by bit to read the topological information of each bounding box.
[0103] In some optional embodiments, prior to performing step 108, the following may also be included: The resolution coefficient is determined based on the actual scene scale and reference unit length corresponding to the model to be clipped.
[0104] Alternatively, the resolution coefficients can be determined based on the following formula (1): Formula (1) The baseline unit length represents the actual length of the scene in space, which can be set according to the size of the scene. For example, when the scene is small, the baseline unit length can be set to 1 pixel representing 1 cm in the scene; while for larger scenes (such as squares), where the cropping object is relatively large, the baseline unit length can be set to 1 pixel representing 1 m in the scene. The scene diagonal length is determined by the size of the scene. For example, if the scene is a cuboid, the scene diagonal length can be determined based on the diagonal length of the cuboid. The scaling factor is a fixed value and can be set according to experience or the scene. For example, the scaling factor can be set to 1. The resolution coefficient is used to identify the relationship between the texture resolution in the target canvas and the scene size.
[0105] The size of the target canvas for displaying the model to be cropped is determined based on the resolution factor.
[0106] Optionally, a value close to the resolution coefficient is determined as the side length of the target canvas. The target canvas size typically has a preset value, usually intelligently adapting between 512×512 and 4096×4096; for example, if the resolution coefficient is determined to be 500, then the target canvas size is determined to be... This embodiment generates a target canvas of corresponding size by monitoring the spatial scale of the actual scene in real time. This allows the model to be cropped to be displayed better on the target canvas, avoiding the problem that the model to be cropped cannot display details due to an unsuitable target canvas size, or that excessive detail leads to excessive computation time.
[0107] In some alternative embodiments, step 108 may include: Render the model to be clipped onto the target canvas; In the target canvas, crop at least one pixel in the model to be cropped based on at least one judgment result.
[0108] In this embodiment, a target canvas of a corresponding size is determined based on the model to be cropped. The model to be cropped can be appropriately displayed on the target canvas, and each part of the model to be cropped can be fully displayed. Therefore, cropping the model to be cropped on the target canvas can quickly and accurately locate and crop the pixels that belong to the bounding box, thus improving the efficiency of 3D model cropping.
[0109] The cropping method for any three-dimensional model provided in this disclosure can be executed by any suitable device with data processing capabilities, including but not limited to terminal devices and servers. Alternatively, the cropping method for any three-dimensional model provided in this disclosure can be executed by a processor, such as by a processor executing the cropping method for any three-dimensional model mentioned in this disclosure by calling corresponding instructions stored in memory. Further details will not be elaborated below.
[0110] Exemplary device Figure 5 This is a schematic diagram of the structure of a three-dimensional model trimming device provided in an exemplary embodiment of this disclosure. Figure 5 As shown, the apparatus provided in this embodiment includes: The data receiving module 51 is used to receive at least one set of coordinates of the bottom vertex of at least one bounding box and at least one box height value, as well as at least one spatial transformation matrix corresponding to at least one bounding box, input by the user.
[0111] Transformation processing module 52 is used to determine at least one initial bitmap based on at least one vertex coordinate set and at least one spatial transformation matrix.
[0112] Bitmap encoding module 53 is used to encode at least one initial bitmap to obtain a target bitmap.
[0113] The pixel judgment module 54 is used to determine whether at least one pixel in the model to be cropped is located in at least one bounding box based on the target bitmap and at least one box height value, and to obtain at least one judgment result.
[0114] The model trimming module 55 is used to trim the model to be trimmed based on at least one judgment result.
[0115] The three-dimensional model clipping device provided in the above embodiments of this disclosure receives at least one set of bottom vertex coordinates and at least one box height value of at least one bounding box input by a user, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; determines at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix; encodes the at least one initial bitmap to obtain a target bitmap; determines whether at least one pixel in the model to be clipped is located in the at least one bounding box based on the target bitmap and the at least one box height value, and obtains at least one judgment result; and clips the model to be clipped according to the at least one judgment result. The embodiments of this disclosure use a target bitmap to represent the initial bitmaps corresponding to multiple bounding boxes, and identify pixels in the model to be clipped based on the target bitmap combined with the box height values of the bounding boxes, thereby achieving rapid clipping judgment and improving the efficiency of model clipping.
[0116] In some optional embodiments, the bitmap encoding module 53 is specifically used to create a preset bitmap with four channels; each of the four channels represents the value in the channel by a binary number of preset bits; at least one initial bitmap is encoded into at least one binary block; each binary block corresponds to an initial bitmap; each binary block includes multiple identical binary numbers; at least one binary block is written into the preset bitmap to obtain the target bitmap.
[0117] Optionally, when writing at least one binary block into a preset bitmap to obtain a target bitmap, the bitmap encoding module 53 is used to determine at least one writing position corresponding to at least one binary block based on at least one spatial transformation matrix; and to encode at least one initial bitmap into at least one binary block by bitmask encoding according to at least one writing position.
[0118] In some optional embodiments, the pixel determination module 54 includes: The coordinate transformation unit is used to transform each pixel in the model to be cropped to at least one local coordinate system corresponding to at least one bounding box, so as to obtain at least one local coordinate value and pixel height value. The judgment unit is used to determine whether a pixel is located in at least one bounding box based on at least one local pixel value and a target bitmap, as well as a pixel height value and at least one box height value.
[0119] Optionally, the coordinate transformation unit is specifically used to transform the pixel points to at least one local coordinate system according to at least one spatial transformation matrix, so as to obtain at least one transformed coordinate of the pixel point in at least one local coordinate system; and to determine at least one local coordinate value and pixel height value according to the coordinate value of the at least one transformed coordinate in the xz plane in at least one local coordinate system.
[0120] Optionally, the judgment unit is specifically used to determine whether a pixel is within the bottom polygon of the bounding box based on at least one local coordinate value and the target bitmap; in response to the pixel being within the bottom polygon of the bounding box, the judgment result is determined based on the pixel height value and at least one box height value.
[0121] Optionally, when determining whether a pixel is within the bottom polygon of a bounding box based on at least one local coordinate value and a target bitmap, the determining unit performs normalization on at least one local coordinate value to obtain a normalized coordinate value; determines the corresponding target binary value in the target bitmap based on the normalized coordinate value; and determines whether the pixel is within the bottom polygon of at least one bounding box based on the target binary value.
[0122] Optionally, when determining the determination result based on the pixel height value and at least one box height value, the determination unit is used to determine the target height value corresponding to the pixel from at least one box height value according to the correspondence between the pixel and the bounding box; determine whether the pixel height value is greater than or equal to zero and less than or equal to the target height value; and determine the determination result of the pixel in the bounding box in response to the pixel height value being greater than or equal to zero and less than or equal to the target height value.
[0123] In some optional embodiments, the transformation processing module 52 is specifically used to determine the local coordinate system corresponding to each bounding box in at least one bounding box based on multiple vertex coordinates included in the vertex coordinate set and the spatial transformation matrix; and to determine an initial bitmap based on the bottom polygon of the bounding box in the local coordinate system.
[0124] Optionally, when determining the initial bitmap based on the bottom polygon of the bounding box in the local coordinate system, the transformation processing module 52 projects the bounding box onto the xz plane of the local coordinate system to obtain the bottom polygon of the bounding box; and performs normalization processing on the bottom polygon in the local coordinate system to obtain the initial bitmap.
[0125] In some optional embodiments, the apparatus provided in this embodiment may further include: The canvas size determination module is used to determine the resolution coefficient based on the actual scene scale and reference unit length corresponding to the model to be cropped; and to determine the size of the target canvas for displaying the model to be cropped based on the resolution coefficient.
[0126] Optionally, the model clipping module is specifically used to render the model to be clipped onto the target canvas; and to clip at least one pixel in the model to be clipped in the target canvas based on at least one judgment result.
[0127] Exemplary electronic devices Below, for reference Figure 6 This describes an electronic device according to embodiments of the present disclosure. The electronic device may be either or both of a first device and a second device, or a standalone device independent of them, which may communicate with the first device and the second device to receive acquired input signals from them.
[0128] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0129] like Figure 6 As shown, the electronic device includes one or more processors and memory.
[0130] A processor can be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and can control other components in an electronic device to perform desired functions.
[0131] The memory can store one or more computer program products, and the memory can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products can be stored on the computer-readable storage medium, and the processor can run the computer program products to implement the three-dimensional model clipping methods of the various embodiments of this disclosure described above and / or other desired functions.
[0132] In one example, the electronic device may also include input devices and output devices, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0133] In addition, the input device may also include, for example, a keyboard, a mouse, etc.
[0134] This output device can output various information to the outside, including determined distance information, direction information, etc. The output device may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0135] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0136] In addition to the methods and apparatus described above, embodiments of this disclosure may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods for trimming three-dimensional models according to various embodiments of this disclosure as described in the foregoing portion of this specification.
[0137] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0138] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the trimming methods for three-dimensional models according to various embodiments of this disclosure as described in the foregoing portion of this specification.
[0139] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0140] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0141] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0142] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.
[0143] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0144] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.
[0145] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0146] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.< / canvas>
Claims
1. A method for trimming a three-dimensional model, characterized in that, include: Receive user input of at least one set of coordinates of at least one bottom vertex of at least one bounding box and at least one box height value, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; Based on the at least one vertex coordinate set and the at least one spatial transformation matrix, at least one initial bitmap is determined; The at least one initial bitmap is encoded to obtain the target bitmap; Based on the target bitmap and the at least one box height value, determine whether at least one pixel in the model to be cropped is located in the at least one bounding box, and obtain at least one judgment result; The model to be clipped is clipped based on at least one of the judgment results.
2. The method according to claim 1, characterized in that, The step of encoding the at least one initial bitmap to obtain the target bitmap includes: Create a preset bitmap for four-channel representation; each of the four channels represents the value in the channel using a binary number of preset bits; The at least one initial bitmap is encoded into at least one binary block; each binary block corresponds to one initial bitmap; each binary block includes multiple identical binary numbers; The at least one binary block is written into the preset bitmap to obtain the target bitmap.
3. The method according to claim 2, characterized in that, The step of writing the at least one binary block into the preset bitmap to obtain the target bitmap includes: At least one write location corresponding to the at least one binary block is determined based on the at least one spatial transformation matrix; According to the at least one write position, the at least one initial bitmap is encoded into the at least one binary block by bitmask encoding.
4. The method according to any one of claims 1-3, characterized in that, The step of determining whether at least one pixel in the model to be cropped is located within the at least one bounding box based on the target bitmap and the at least one box height value, and obtaining at least one judgment result, includes: For each pixel in the model to be cropped, the pixel is transformed into at least one local coordinate system corresponding to the at least one bounding box to obtain at least one local coordinate value and pixel height value; Based on the at least one local pixel value and the target bitmap, as well as the pixel height value and the at least one box height value, a determination result is made as to whether the pixel is located within the at least one bounding box.
5. The method according to claim 4, characterized in that, The step of transforming the pixels in the model to be cropped to at least one local coordinate system corresponding to the at least one bounding box, to obtain at least one local coordinate value and pixel height value, includes: The pixel is transformed to the at least one local coordinate system according to the at least one spatial transformation matrix, so as to obtain at least one transformed coordinate of the pixel in the at least one local coordinate system; The at least one local coordinate value and the pixel height value are determined based on the coordinate values of the at least one transformed coordinate in the xz plane of the at least one local coordinate system.
6. The method according to claim 4 or 5, characterized in that, The determination of whether a pixel is located within the at least one bounding box based on the at least one local coordinate value, the target bitmap, the pixel height value, and the at least one box height value includes: Based on the at least one local coordinate value and the target bitmap, determine whether the pixel is within the bottom polygon of the bounding box; In response to the pixel being located within the bottom polygon of the bounding box, the determination result is determined based on the pixel height value and the at least one box height value.
7. The method according to claim 6, characterized in that, Determining whether a pixel is within the bottom polygon of the bounding box based on the at least one local coordinate value and the target bitmap includes: Normalize the at least one local coordinate value to obtain normalized coordinate values; Based on the normalized coordinate values, the corresponding target binary value is determined in the target bitmap; Determine whether the pixel is within the bottom polygon of the at least one bounding box based on the target binary value.
8. The method according to any one of claims 1-8, characterized in that, Determining at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix includes: For each of the at least one bounding boxes, a local coordinate system corresponding to the bounding box is determined based on multiple vertex coordinates included in the vertex coordinate set and the spatial transformation matrix; In the local coordinate system, the initial bitmap is determined based on the bottom polygon of the bounding box.
9. The method according to any one of claims 1-8, characterized in that, Before determining whether at least one pixel in the model to be cropped is located within the at least one bounding box based on the target bitmap and the at least one box height value, and obtaining the determination result, the method further includes: The resolution coefficient is determined based on the actual scene scale and reference unit length corresponding to the model to be clipped; The size of the target canvas for displaying the model to be cropped is determined based on the resolution coefficient.
10. A cutting device for a three-dimensional model, characterized in that, include: The data receiving module is used to receive at least one set of coordinates of the bottom face vertices of at least one bounding box and at least one box height value input by the user, as well as at least one spatial transformation matrix corresponding to the at least one bounding box; A transformation processing module is used to determine at least one initial bitmap based on the at least one vertex coordinate set and the at least one spatial transformation matrix; A bitmap encoding module is used to encode the at least one initial bitmap to obtain a target bitmap; The pixel determination module is used to determine whether at least one pixel in the model to be cropped is located in the at least one bounding box based on the target bitmap and the at least one box height value, and to obtain at least one determination result; The model trimming module is used to trim the model to be trimmed based on the at least one judgment result.