CN116645474A - Cutting method, device and equipment for three-dimensional home decoration model - Google Patents

Cutting method, device and equipment for three-dimensional home decoration model Download PDF

Info

Publication number
CN116645474A
CN116645474A CN202310682259.8A CN202310682259A CN116645474A CN 116645474 A CN116645474 A CN 116645474A CN 202310682259 A CN202310682259 A CN 202310682259A CN 116645474 A CN116645474 A CN 116645474A
Authority
CN
China
Prior art keywords
cutting
target
outline
cut
sketch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310682259.8A
Other languages
Chinese (zh)
Inventor
张云剑
田素凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meiping Meiwu Shanghai Technology Co ltd
Original Assignee
Meiping Meiwu Shanghai Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Meiping Meiwu Shanghai Technology Co ltd filed Critical Meiping Meiwu Shanghai Technology Co ltd
Priority to CN202310682259.8A priority Critical patent/CN116645474A/en
Publication of CN116645474A publication Critical patent/CN116645474A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10012Stereo images
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a method, a device and equipment for cutting a three-dimensional home decoration model, wherein the method comprises the following steps: the method comprises the steps that electronic equipment responds to preset interactive operation of a user on a three-dimensional home decoration model, and an object to be cut and a cutting body in the three-dimensional home decoration model are determined; the object to be cut consists of a plurality of triangular surfaces; in the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour; and performing triangularization treatment on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result. The electronic equipment realizes the cutting process of the three-dimensional home decoration model based on two-dimensional cutting calculation, reduces the calculation complexity, improves the cutting calculation speed, shortens the cutting time consumption of the three-dimensional home decoration model, and can improve the use experience of users.

Description

Cutting method, device and equipment for three-dimensional home decoration model
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for cutting a three-dimensional home decoration model.
Background
With the continuous development of internet technology, the variety of three-dimensional design software is continuously increased, and the functions are also more and more abundant.
In the application process of the three-dimensional design software, the situation that one three-dimensional body is cut by another three-dimensional body, for example, a wallboard is cut by a door opening, a background wall is cut by the door opening, and the like, often occurs. In the related art, three-dimensional design software cannot realize the function of cutting a three-dimensional home decoration model, and a user needs to realize the function by means of a traditional three-dimensional cutting algorithm, but the traditional three-dimensional cutting algorithm is slow in cutting speed, long in time consumption and poor in use experience of the user.
Disclosure of Invention
The application provides a cutting method, a device and equipment for a three-dimensional home decoration model, which are used for realizing rapid cutting of the three-dimensional home decoration model, improving cutting speed, shortening cutting time and improving user experience.
In a first aspect, an embodiment of the present application provides a method for cutting a three-dimensional home decoration model, including:
responding to preset interactive operation of a user on a three-dimensional home decoration model, and determining an object to be cut and a cutting body in the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces;
In the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is a plane in which the sketch outline is located;
determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour;
and performing triangulation processing on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result.
In one possible embodiment, the method further comprises:
determining conversion parameters between a first coordinate system corresponding to the object to be cut and a second coordinate system corresponding to the sketch plane;
and carrying out coordinate transformation on vertex coordinates corresponding to the vertexes in the object to be cut and vertex normal vectors based on the transformation parameters to obtain the object to be cut in a second coordinate system.
In one possible embodiment, the method further comprises:
determining a boundary box corresponding to the sketch outline;
if the bounding box is not intersected with the triangular surface in the object to be cut, the triangular surface is directly stored into the target cutting object.
In a possible implementation manner, the cutting the triangular surface based on the sketch outline to obtain an alternative cutting outline includes:
cutting the triangular surface according to a vertical cutting mode under the condition that the triangular surface is vertical to the sketch plane, so as to obtain the alternative cutting profile;
and under the condition that the triangular surface is not perpendicular to the sketch plane, cutting the triangular surface in a non-perpendicular cutting mode to obtain the alternative cutting profile.
In a possible implementation manner, the cutting the triangular surface according to a vertical cutting manner to obtain the alternative cutting profile includes:
projecting the triangular surface into the sketch plane to obtain a to-be-cut line segment;
and determining the part, overlapped with the sketch outline, of the to-be-cut line section to obtain the alternative cutting outline.
In a possible implementation manner, the determining, based on the alternative cutting profile, the target cutting profile corresponding to the object to be cut in the three-dimensional home decoration model includes:
reflecting the alternative cutting outline into the plane of the triangular surface, and determining a cutting frame based on the alternative cutting outline and a preset stretching height;
The target crop profile is determined based on the crop box and the triangular face.
In one possible implementation manner, the cutting the triangular surface according to the non-vertical cutting manner to obtain the alternative cutting profile includes:
projecting the triangular surface into the sketch plane to obtain a triangular surface to be cut;
and cutting the triangular surface to be cut based on the sketch outline to obtain the alternative cutting outline.
In a possible implementation manner, the determining, based on the alternative cutting profile, the target cutting profile corresponding to the object to be cut in the three-dimensional home decoration model includes:
and reflecting the alternative cutting profile to the plane of the triangular surface to obtain the target cutting profile.
In one possible implementation manner, the triangulating the target cutting profile to obtain a target cutting result includes:
processing the target cutting outline based on a preset triangulation algorithm to obtain a triangular surface set;
and determining vertex coordinates, normal vectors and UV values of all vertexes in the triangular surface set to obtain the target cutting result.
In one possible embodiment, the method further comprises:
Determining a target side line corresponding to the target cutting result in a stretching plane corresponding to each side line of the sketch outline;
generating a target plane area contour based on the target side line; the target plane is an area needing to be subjected to plane repair in the object to be cut;
and carrying out triangulation on the outline of the target plane area to obtain a target surface complement result, and adding the target surface complement result into the target cutting result.
In a second aspect, an embodiment of the present application provides a cutting device for a three-dimensional home decoration model, including:
the first determining module is used for determining an object to be cut and a cutting body in the three-dimensional home decoration model in response to preset interactive operation of a user on the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces;
the cutting module is used for carrying out cutting calculation on the triangular surface based on the sketch outline in the sketch plane to obtain an alternative cutting outline; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is a plane in which the sketch outline is located;
the second determining module is used for determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour;
And the display module is used for carrying out triangulation processing on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result.
In one possible embodiment, the apparatus is further for:
determining conversion parameters between a first coordinate system corresponding to the object to be cut and a second coordinate system corresponding to the sketch plane;
and carrying out coordinate transformation on vertex coordinates corresponding to the vertexes in the object to be cut and vertex normal vectors based on the transformation parameters to obtain the object to be cut in a second coordinate system.
In one possible embodiment, the apparatus is further for:
determining a boundary box corresponding to the sketch outline;
if the bounding box is not intersected with the triangular surface in the object to be cut, the triangular surface is directly stored into the target cutting object.
In one possible embodiment, the cutting module is specifically configured to:
cutting the triangular surface according to a vertical cutting mode under the condition that the triangular surface is vertical to the sketch plane, so as to obtain the alternative cutting profile;
and under the condition that the triangular surface is not perpendicular to the sketch plane, cutting the triangular surface in a non-perpendicular cutting mode to obtain the alternative cutting profile.
In one possible embodiment, the cutting module is specifically configured to:
projecting the triangular surface into the sketch plane to obtain a to-be-cut line segment;
and determining the part, overlapped with the sketch outline, of the to-be-cut line section to obtain the alternative cutting outline.
In one possible embodiment, the cutting module is specifically configured to:
reflecting the alternative cutting outline into the plane of the triangular surface, and determining a cutting frame based on the alternative cutting outline and a preset stretching height;
the target crop profile is determined based on the crop box and the triangular face.
In a possible implementation manner, the second determining module is specifically configured to:
projecting the triangular surface into the sketch plane to obtain a triangular surface to be cut;
and cutting the triangular surface to be cut based on the sketch outline to obtain the alternative cutting outline.
In a possible implementation manner, the second determining module is specifically configured to:
and reflecting the alternative cutting profile to the plane of the triangular surface to obtain the target cutting profile.
In a possible implementation manner, the display module is specifically configured to:
Processing the target cutting outline based on a preset triangulation algorithm to obtain a triangular surface set;
and determining vertex coordinates, normal vectors and UV values of all vertexes in the triangular surface set to obtain the target cutting result.
In one possible embodiment, the apparatus is further for:
determining a target side line corresponding to the target cutting result in a stretching plane corresponding to each side line of the sketch outline;
generating a target plane area contour based on the target side line; the target plane is an area needing to be subjected to plane repair in the object to be cut;
and carrying out triangulation on the outline of the target plane area to obtain a target surface complement result, and adding the target surface complement result into the target cutting result.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory, such that the processor performs the method of cutting a three-dimensional home model according to any one of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having stored therein computer-executable instructions for implementing a method for trimming a three-dimensional home decoration model according to any one of the first aspects when the computer-executable instructions are executed by a processor.
In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements a method for cutting a three-dimensional home model as set forth in any one of the first aspects.
In the embodiment of the application, the electronic equipment responds to preset interactive operation of a user on the three-dimensional home decoration model to determine an object to be cut and a cutting body in the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces; in the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is the plane in which the sketch outline is located; determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour; and performing triangularization treatment on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result. According to the embodiment of the application, the electronic equipment performs two-dimensional cutting calculation based on the sketch plane, then converts the alternative cutting outline into the target cutting outline in the three-dimensional home decoration model, and further obtains the target cutting result, so that the cutting process of the three-dimensional home decoration model is realized based on the two-dimensional cutting calculation, the calculation complexity is reduced, the rapid cutting of the three-dimensional home decoration model can be realized, the cutting calculation speed is improved, the cutting time consumption of the three-dimensional home decoration model is shortened, and the use experience of a user can be improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a schematic diagram of an application scenario provided in an exemplary embodiment of the present application;
fig. 2 is a schematic flow chart of a method for cutting a three-dimensional home decoration model according to an exemplary embodiment of the present application;
fig. 3 is a flowchart illustrating another method for cutting a three-dimensional home decoration model according to an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of a vertical cutting method according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a non-vertical cutting method according to an exemplary embodiment of the present application;
fig. 6 is a schematic view of a technical link for cutting a three-dimensional home decoration model according to an exemplary embodiment of the present application;
fig. 7 is a schematic structural diagram of a cutting device for a three-dimensional home decoration model according to an exemplary embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of related data is required to comply with the relevant laws and regulations and standards of the relevant country and region, and is provided with corresponding operation entries for the user to select authorization or rejection.
With the continuous development of internet technology, the variety of three-dimensional design software is continuously increased, and the software functions are also more and more abundant. In three-dimensional design software for home decoration, three-dimensional body cutting scenes are common, such as a wall panel being cut by a door opening, a background wall being cut by a door opening, and the like. In the related art, the existing three-dimensional design software generally cannot realize the function of three-dimensional cutting, so that a user needs to resort to a traditional three-dimensional cutting algorithm, the traditional three-dimensional cutting algorithm has higher computational complexity, lower cutting speed, longer time consumption and poor use experience of the user.
Fig. 1 is a schematic diagram of an application scenario provided in an exemplary embodiment of the present application. As shown in fig. 1, includes an electronic device 101. The electronic device 101 may be a mobile phone, a computer, a wearable device, etc., and the embodiment of the application is not limited to the specific type of the electronic device 101. As shown in fig. 1, in the related art, the electronic device 101 generally implements trimming based on a conventional three-dimensional trimming algorithm in a three-dimensional trimming scene, and the trimming speed is slow, and the time is long, and typically requires a trimming time of about 40 seconds(s); in the embodiment of the application, the electronic device 101 converts three-dimensional cutting into two-dimensional plane calculation by the cutting method of the three-dimensional home decoration model based on the cutting body, so that the complexity of three-dimensional cutting can be reduced, the cutting speed is improved, the three-dimensional home decoration model can be cut in about 3 to 4 seconds, and the time consumption of three-dimensional cutting is greatly shortened.
In the embodiment of the application, the electronic equipment responds to the preset interactive operation of a user on the three-dimensional home decoration model to determine an object to be cut and a cutting body in the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces; in the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is the plane in which the sketch outline is located; determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour; and performing triangularization treatment on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result. According to the embodiment of the application, the electronic equipment performs two-dimensional cutting calculation based on the sketch plane, then converts the alternative cutting outline into the target cutting outline in the three-dimensional home decoration model, and further obtains the target cutting result, so that the cutting process of the three-dimensional home decoration model is realized based on the two-dimensional cutting calculation, the calculation complexity is reduced, the rapid cutting of the three-dimensional home decoration model can be realized, the cutting calculation speed is improved, the cutting time consumption of the three-dimensional home decoration model is shortened, and the use experience of a user can be improved.
The technical scheme shown in the application is described in detail by specific examples. It should be noted that the following embodiments may exist alone or in combination with each other, and for the same or similar content, the description will not be repeated in different embodiments.
Fig. 2 is a flow chart of a cutting method of a three-dimensional home decoration model according to an exemplary embodiment of the present application. Referring to fig. 2, the method for cutting the three-dimensional home decoration model may include:
s201, determining an object to be cut and a cutting body in the three-dimensional home decoration model in response to preset interactive operation of a user on the three-dimensional home decoration model; the object to be cut is composed of a plurality of triangular faces.
The execution main body of the embodiment of the application can be electronic equipment or a cutting device of a three-dimensional home decoration model arranged in the electronic equipment. The cutting device of the three-dimensional home decoration model can be realized by software or by combination of software and hardware. For ease of understanding, hereinafter, an execution body will be described as an example of an electronic device.
In the embodiment of the application, the three-dimensional home decoration model can be a three-dimensional (3D) home decoration design model which needs to be cut, and in a home design scene, the three-dimensional home decoration model can be a whole house 3D model and the like. The object to be cut may refer to an object to be cut, and may also be referred to as a cut object (mesh), and specifically may be a wall panel, a background wall, a door wall, or the like. The three-dimensional home model can be realized based on triangular meshes (triangulars), a 3D model is obtained by combining a plurality of triangles at different angles (shared edges or shared angles), and each Triangle at the periphery forms a triangular mesh. Correspondingly, the object to be cut is also composed of a plurality of triangular surfaces as a part of the three-dimensional home decoration model.
The preset interactive operation may refer to an operation of triggering a three-dimensional cutting process by a user, specifically may refer to a click operation of a preset cutting control by the user, or may refer to a sliding and dragging operation of dragging a cutting body to an object to be cut, or may refer to a click operation of an input device such as a mouse by the user, and the embodiment of the present application does not limit a specific type of the preset interactive operation. The cutting body may be an object for cutting an object to be cut, such as a door, a window, a wall hole, or the like.
In the step, when a user needs to cut a certain object to be cut in the three-dimensional home decoration model, the three-dimensional cutting process can be triggered through preset interactive operation, for example, a cutting body can be dragged to an area of the object to be cut, and the like; the electronic device responds to the preset interactive operation of the user, and can determine the object to be cut and the cutting body corresponding to the preset interactive operation, specifically, the specific graphic coordinates of the object to be cut, the vertex coordinates of each triangular surface and the like, and meanwhile, the coordinate parameters and the like of the cutting body can be determined.
S202, in a sketch plane, cutting and calculating a triangular surface based on the sketch outline to obtain an alternative cutting outline; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is the plane in which the sketch outline is located.
In the embodiment of the application, the cutting body can also be called a stretching body (extruder), and is a three-dimensional shape constructed by a stretching modeling mode, specifically, the three-dimensional shape is obtained by stretching a sketch outline according to a stretching height on a sketch plane. The sketch outline (polygon) may refer to a basic figure outline of the stretched body, and may specifically refer to a cross-sectional figure of the stretched body. The sketch plane (chord) may refer to the plane in which the sketch outline lies. The stretching height (height) may refer to a stretching height value that is set by a user based on actual requirements. On the sketch plane, the electronic equipment can stretch the sketch outline according to the stretching height, and a three-dimensional shape can be obtained, and the three-dimensional shape is a cutting body. Taking a door and window hole cutting wall surface as an example, the wall surface or an accessory model of the wall surface is a cut object, the door and window hole is a cutting body, a plane of the wall surface can be used as a sketch plane, a contour of the door and window hole can be used as a sketch contour, and the stretching height can be a preset stretching height. Therefore, in the embodiment of the application, the cutting body is represented by the sketch plane, the sketch outline and the stretching height, the abstraction of the cutting object is realized, the three-dimensional home decoration model is cut by using the cutting body, the calculated amount of the subsequent cutting algorithm based on the cutting body is smaller, and the cutting speed is faster.
The alternative cut profile may refer to a cut area profile determined in the sketch plane, and may be a polygon or a line segment based on whether the triangular surface is perpendicular to the sketch plane.
In this step, since the object to be cut is represented based on the world coordinate system in which the three-dimensional home decoration model is located, the cutting body is realized based on the sketch plane local coordinate system when cutting the object to be cut. The electronic equipment can convert the object to be cut from the world coordinate system where the three-dimensional home decoration model is located to the local coordinate system where the sketch plane is located, and each triangular surface of the corresponding object to be cut can also be converted to the local coordinate system of the sketch plane, so that the accuracy of cutting can be ensured. Then, the electronic equipment can cut the triangular surface based on the sketch outline in the sketch plane, and the alternative cutting outline is obtained by cutting calculation based on the two-dimensional plane, so that the complexity of cutting calculation can be reduced, and the cutting calculation amount is reduced.
S203, determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour.
In the embodiment of the application, the target cutting contour may refer to a cutting area contour corresponding to each surface of the object to be cut in the three-dimensional home decoration model. After the alternative cutting outline on the two-dimensional plane is obtained by cutting calculation in the sketch plane, the electronic equipment can convert the alternative cutting outline into the three-dimensional home model to obtain the target cutting outline.
S204, performing triangularization processing on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result.
In the embodiment of the present application, the target cutting result may refer to an algorithm output result after cutting of the three-dimensional home decoration model, and specifically may include coordinate parameters of vertices, for example, coordinates of vertices after cutting, normal vectors of vertices, and the like. The target three-dimensional home decoration model may refer to a three-dimensional home decoration model obtained after cutting. The target trimming object may refer to an object to be trimmed obtained after trimming.
In this step, after determining the target cutting contour of the object to be cut in the three-dimensional home decoration model, the electronic device may triangulate the target cutting contour to obtain a plurality of triangular surfaces, and may determine the coordinate parameters of each vertex to obtain the target cutting result. And then, the electronic equipment can display the target three-dimensional home decoration model and the target cutting object after cutting based on the target cutting result, so as to realize the cutting process of the three-dimensional home decoration model.
In the embodiment of the application, the electronic equipment responds to preset interactive operation of a user on the three-dimensional home decoration model to determine an object to be cut and a cutting body in the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces; in the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is the plane in which the sketch outline is located; determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour; and performing triangularization treatment on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result. According to the embodiment of the application, the electronic equipment performs two-dimensional cutting calculation based on the sketch plane, then converts the alternative cutting outline into the target cutting outline in the three-dimensional home decoration model, and further obtains the target cutting result, so that the cutting process of the three-dimensional home decoration model is realized based on the two-dimensional cutting calculation, the calculation complexity is reduced, the rapid cutting of the three-dimensional home decoration model can be realized, the cutting calculation speed is improved, the cutting time consumption of the three-dimensional home decoration model is shortened, and the use experience of a user can be improved.
On the basis of the above embodiment, fig. 3 is a schematic flow chart of another method for cutting a three-dimensional home decoration model according to an exemplary embodiment of the present application. Referring to fig. 3, the method for cutting the three-dimensional home decoration model may include:
s301, determining conversion parameters between a first coordinate system corresponding to an object to be cut and a second coordinate system corresponding to a sketch plane; and carrying out coordinate transformation on vertex coordinates corresponding to the vertexes in the object to be cut and vertex normal vectors based on the transformation parameters to obtain the object to be cut under the second coordinate system.
In the embodiment of the present application, the first coordinate system may refer to a world coordinate system of a three-dimensional home model to which the object to be cut belongs, and illustratively, in a home design scene, a z-axis in the first coordinate system may be perpendicular to a ground direction. The second coordinate system may refer to the local coordinate system in which the sketch plane is located, and for example, in a home design scenario, the z-axis of the second coordinate system may be perpendicular to the panel, parallel to the ground, when the object to be cut is the panel. The transformation parameters may refer to transformation mapping parameters between coordinate systems.
In this step, when three-dimensional cutting is performed, the electronic device first needs to convert the object to be cut into the sketch plane local coordinate system of the cutting body, so as to facilitate the subsequent cutting of directly calculating the triangular surface and the sketch outline in two dimensions. Specifically, the electronic device may calculate the conversion parameters from the first coordinate system to the second coordinate system, specifically may be a rigid transformation matrix or the like, and then may convert the vertex coordinates and vertex normal vectors of each vertex with respect to the electronic device, specifically may be rigid transformation or the like, to obtain the object to be cut in the second coordinate system, so that through coordinate transformation, the accuracy of three-dimensional cutting can be improved, and cutting calculation can be performed in the same coordinate system, and the complexity of calculation can be reduced. Of course, if the coordinate conversion of the object to be cut in the three-dimensional home decoration model has already been completed, the electronic device may skip step S301, which is not limited in the embodiment of the present application.
S302, determining a boundary box corresponding to the sketch outline; if the bounding box is not intersected with the triangular surface in the object to be cut, the triangular surface is directly stored in the target cutting object.
In the embodiment of the application, the bounding box may refer to a bounding box corresponding to a sketch outline. When three-dimensional cutting is performed, the object to be cut comprises a plurality of triangular faces, the cutting body may only need to cut a part of the triangular faces, and the rest triangular faces may not need to be cut. Therefore, after the object to be cut is converted into the second coordinate system, the electronic device can traverse each triangular surface to determine whether each triangular surface is intersected with the sketch outline or not, then cutting processing can be carried out on the triangular surface intersected with the sketch outline, and the triangular surface not intersected with the sketch outline can be directly stored in the target cutting object, so that the calculation amount of cutting processing can be reduced, and the complexity of cutting calculation is reduced.
Specifically, when determining whether the triangular surface and the sketch outline intersect, the electronic device may determine a bounding box corresponding to the sketch outline, where the bounding box may completely enclose the entire sketch outline, and may specifically be determined based on a bounding box generation algorithm (bounding box); the electronic device may then determine whether the bounding box intersects the triangular surface, or may specifically project the triangular surface into a sketch plane, determine whether the projected triangular surface intersects the bounding box, or may stretch the bounding box according to a stretching height to obtain a stretched body, and determine whether the stretched body intersects the triangular surface.
It should be noted that, the electronic device may also determine whether the whole object to be cut intersects with the bounding box of the cutting body, if not, the object to be cut may be directly output, without executing subsequent cutting processing; when determining that the object to be cut is intersected with the cutting body, the electronic equipment can traverse each triangular surface to determine whether the triangular surfaces are intersected with the boundary frame of the sketch outline, and the disjoint triangular surfaces do not need to be cut, so that unnecessary calculation can be avoided, and the cutting speed is increased.
S303, if the boundary box is intersected with the triangular surface in the object to be cut, cutting the triangular surface according to a vertical cutting mode under the condition that the triangular surface is vertical to the sketch plane, so as to obtain an alternative cutting profile; and under the condition that the triangular surface is not perpendicular to the sketch plane, cutting the triangular surface in a non-perpendicular cutting mode to obtain an alternative cutting profile.
S304, determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour.
In the embodiment of the application, when the electronic equipment determines that the boundary box of the sketch outline intersects with the triangular surface of the object to be cut, the electronic equipment can further determine whether the triangular surface is vertical to the sketch plane where the sketch outline is located, and if so, the electronic equipment can perform cutting treatment in a vertical cutting mode to obtain the alternative cutting outline. If not, the electronic device can perform cutting processing according to a non-vertical cutting mode to obtain alternative cutting profiles. And then the electronic equipment can convert the alternative cutting outline into the three-dimensional home decoration model to obtain the target cutting outline of the object to be cut. For example, in the sketch plane, the electronic device may delete the triangular surface area included inside the sketch outline, reserve the triangular surface area outside the sketch outline, and then reflect to the plane in which the triangular surface is located, so as to obtain the target cutting outline.
Specifically, when determining whether the triangular surface is perpendicular to the sketch plane, the electronic device may project the triangular surface into the sketch plane, if the triangular surface is projected as a line segment in the sketch plane, the triangular surface is perpendicular to the sketch plane, and if the triangular surface is not projected as a line segment, the triangular surface is not perpendicular to the sketch plane. Of course, the electronic device may determine whether the triangular surface is perpendicular to the sketch plane based on other manners, which are not limited by the embodiment of the present application.
In one possible embodiment, when the triangular surface is perpendicular to the sketch plane, the determining process of the target cut profile may include the following steps (1) to (4):
(1) And projecting the triangular surface into a sketch plane to obtain a to-be-cut line section.
(2) And determining the part, overlapping with the sketch outline, of the line segment to be cut to obtain an alternative cutting outline.
In the embodiment of the present application, the to-be-cut line segment may refer to a line segment obtained after the triangular surface is projected onto the sketch plane, and may be denoted as L. When the triangular surface is perpendicular to the sketch plane, the electronic device can project the triangular surface into the sketch plane to obtain the to-be-cut line segment. The electronic device may determine, based on a subtraction operation (difference), a portion where the to-be-cut line segment and the sketch outline do not overlap, and may be denoted as a non-cut segment L1, and then the electronic device may subtract the to-be-cut line segment L from the non-cut segment L1 to obtain a cut segment L2, where the cut segment L2 may be used as an alternative cut outline determined in the sketch plane. The subtraction operation may be an algorithm in a database programming language, clippers Library (clippers Library), which may include various functional algorithms for Clipping (Clipping) line segments and polygons, and biasing (offset).
(3) And reflecting the alternative cutting profile into the plane of the triangular surface, and determining the cutting frame based on the alternative cutting profile and the preset stretching height.
(4) And determining the target cutting outline based on the cutting frame and the triangular surface.
In the embodiment of the present application, the preset stretching height may refer to a stretching height corresponding to the cutting body. The cut frame may refer to a cut graphic frame of a plane in which the triangular face is located. After determining the alternative cutting contour, the electronic device may reflect the alternative cutting contour into the plane where the triangular surface is located, where a specific reflection manner may be that two rays are emitted from two endpoints of the alternative cutting contour, that is, the cutting section L2, perpendicular to the sketch plane, and a line segment formed by an intersection point of the two rays and the triangular surface is the alternative cutting contour where the triangular surface is located. And then, stretching the electronic equipment in the plane of the triangular surface perpendicular to the alternative cutting outline according to the stretching height to obtain a rectangular frame, wherein the rectangular frame is the cutting frame. After determining the cutting frame, the electronic device can perform subtraction operation on the triangular surface and the cutting frame, and cut off the overlapped part of the triangular surface and the cutting frame, so that the target cutting outline of the rest part can be obtained.
Fig. 4 is a schematic diagram illustrating a vertical cutting manner according to an exemplary embodiment of the present application. As shown in fig. 4, when the triangular surface is perpendicular to the sketch plane, the projection of the triangular surface in the sketch plane is the cut-line segment L to be cut. The electronic equipment can perform subtraction operation on the sketch outline (polygon) and the section to be cut, and cut off the overlapped part of the sketch outline (polygon) and the section to be cut to obtain an uncut section, namely a non-cutting section L1; then the electronic device can subtract the to-be-cut line segment L from the non-cut segment L1 to obtain a cut segment L2, and the cut segment L2 can be used as an alternative cut contour determined by the electronic device on a sketch plane. Then, the electronic device may reflect the alternative cutting outline into the plane where the triangular surface is located, and construct a cutting frame in the plane where the triangular surface is located, where the specific construction manner may be that the alternative cutting outline is vertically and upwardly stretched according to the stretching height to obtain a rectangular cutting frame, so that the electronic device performs subtraction operation on the cutting frame and the triangular surface, and a target area outline composed of four vertices A, B, C, D in fig. 4 may be obtained, and the subsequent electronic device may re-triangulate the target area outline to obtain the triangular surface 1 and the triangular surface 2.
In the embodiment of the application, when the triangular surface is perpendicular to the sketch plane, the electronic equipment determines the alternative cutting outline in the sketch plane, constructs the cutting frame based on the alternative cutting outline in the plane where the triangular surface is located, and then performs subtraction operation on the cutting frame and the triangular surface to finally obtain the target cutting outline, so that the cutting of the three-dimensional home decoration model can be converted into two-dimensional cutting calculation, the calculation complexity can be reduced, and the cutting speed can be increased.
In another possible embodiment, when the triangle surface is not perpendicular to the sketch plane, the determining process of the target clipping profile may include the following steps (5) to (7):
(5) And projecting the triangular surface into a sketch plane to obtain the triangular surface to be cut.
(6) And cutting the triangular surface to be cut based on the sketch outline to obtain an alternative cutting outline.
(7) And reflecting the alternative cutting profile to the plane of the triangular surface to obtain the target cutting profile.
In the embodiment of the application, the triangular surface to be cut may refer to a projected triangle of the triangular surface on the sketch plane when the triangular surface is not perpendicular to the sketch plane. Specifically, when the triangular surface is not perpendicular to the sketch plane, that is, the triangular surface is inclined to the sketch plane, the electronic device may project the triangular surface into the sketch plane to obtain the triangular surface to be cut after projection. Then, the electronic equipment can perform subtraction operation on the triangular surface to be cut and the sketch outline, and cut off the overlapped part of the triangular surface to be cut and the sketch outline, so that the two-dimensional alternative cutting outline can be obtained; and the electronic equipment reflects the alternative cutting outline to the plane where the triangular surface is located, so that the target cutting outline in the three-dimensional space can be obtained. The specific reflection mode can be that rays are generated from all vertexes of the alternative cutting outline perpendicular to the sketch plane, and the intersection point of the rays and the triangular surface is all vertexes of the target cutting outline.
Fig. 5 is a schematic diagram illustrating a non-vertical cutting manner according to an exemplary embodiment of the present application. As shown in fig. 5, when the triangular surface is not perpendicular to the sketch plane, the projection of the triangular surface in the sketch plane is also a triangle, i.e. the triangular surface to be cut. The electronic device performs a subtraction operation on the sketch outline (rectangular frame in fig. 5) and the triangle surface to be cut, so as to obtain an alternative cutting outline on the sketch plane, namely a quadrilateral formed by four vertexes E, F, G, H in the figure. The subsequent electronic device may obtain the target clipping profile based on the alternative clipping profile, and after triangulating, triangular faces 1 and 2 may be obtained.
In the embodiment of the application, when the triangular surface is not perpendicular to the sketch plane, the electronic equipment can perform subtraction operation on the projection of the triangular surface on the sketch plane and the sketch contour to obtain the alternative cutting contour on the two-dimensional plane, and then the alternative cutting contour can be reflected to the plane where the triangular surface is positioned to obtain the target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model, so that three-dimensional cutting can be converted into two-dimensional plane calculation, the calculation complexity can be reduced, and the cutting speed can be increased.
It should be understood that, in various embodiments of the present application, the sequence number of each process does not mean that the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
S305, processing the target cutting outline based on a preset triangulation algorithm to obtain a triangular surface set; and determining vertex coordinates, normal vectors and UV values of all vertexes in the triangular surface set to obtain a target cutting result.
In the embodiment of the present application, the preset triangulation algorithm may refer to a preset triangulation discrete processing algorithm, and in particular may refer to an ear-cut algorithm (earcut) or the like. The triangular surface set may include a plurality of discrete triangular surfaces obtained by triangulating the target cut contour. The target clipping results may include vertex parameters of each vertex after three-dimensional clipping, such as vertex coordinates, vertex normal vectors, and vertex UV values. The vertex UV value may refer to texture coordinate values of the vertex, and is used to express texture information.
In the step, after determining the target cutting outline after cutting each triangular surface, the electronic device can re-triangulate the target cutting outline based on a preset triangulate algorithm to obtain a discrete triangular surface set; it should be noted that, the electronic device may output vertex coordinates and vertex normal vectors of each vertex based on a preset triangulation algorithm, and then the electronic device may calculate UV values corresponding to the vertex coordinates to obtain a target cutting result. Thus, the electronic device can improve the accuracy and rationality of three-dimensional cutting by triangulating the target cutting profile and determining the target cutting result.
S306, determining a target edge corresponding to a target cutting result in a stretching plane corresponding to each edge of the sketch outline; generating a target plane area contour based on the target edge; the target plane is the area needing to be planar repaired in the object to be cut.
S307, triangularizing the outline of the target plane area to obtain a target face complement result, and adding the target face complement result into a target cutting result.
In the embodiment of the application, after the object to be cut is cut by the cutting body, a blank plane is usually formed on the side line of the sketch outline of the cutting body, and the electronic equipment can repair the plane at the moment so as to optimize the display effect of the target three-dimensional home decoration model. The stretching plane may refer to a plane obtained after stretching each edge of the sketch outline, and may refer to each plane of the cut body. The target edge may refer to an edge on a stretched plane in the set of triangular faces obtained after the triangulating process. The target plane area outline may be an area outline obtained after the target side line is closed, and the target plane is a plane to be repaired after three-dimensional cutting. The target surface complement result may refer to vertex parameters of each vertex obtained after the surface complement, such as vertex coordinates, vertex normal vectors, and vertex UV values.
In this step, after the electronic device cuts the object to be cut based on the cutting body, a blank plane is usually formed, and the electronic device needs to repair the plane to optimize the display effect of the target three-dimensional home decoration model. After the triangular surface set and the target cutting result are obtained, aiming at a stretching plane corresponding to each side line of the sketch outline, the electronic equipment can firstly determine a target side line positioned in the stretching plane, and then can perform space loop searching treatment on the target side line to determine a target plane area outline formed by the target side line; then the electronic equipment can perform triangulation processing on the outline of the target plane area based on a preset triangulation algorithm to obtain a triangular surface set corresponding to the target plane, further a target surface complement result can be calculated and obtained, finally the target surface complement result can be added into a target cutting result, and the subsequent electronic equipment can integrally display the target triangular model, so that each surface of an object to be cut after three-dimensional cutting can be ensured to be displayed in a closed mode, and the display effect of the target three-dimensional home decoration model can be optimized.
And S308, displaying the target cutting object in the target three-dimensional home decoration model according to the target cutting result.
In the embodiment of the application, after the target cutting result is obtained, the electronic equipment can display the target three-dimensional home decoration model after cutting, wherein the target three-dimensional home decoration model comprises the target cutting object after cutting. In this way, the electronic device in the embodiment of the application performs two-dimensional cutting calculation based on the sketch plane, then converts the alternative cutting outline into the target cutting outline in the three-dimensional home decoration model, and further obtains the target cutting result, so that the cutting process of the three-dimensional home decoration model is realized based on the two-dimensional cutting calculation, the calculation complexity is reduced, the rapid cutting of the three-dimensional home decoration model can be realized, the cutting calculation speed is improved, the cutting time consumption of the three-dimensional home decoration model is shortened, and the use experience of a user can be improved.
On the basis of any one of the above embodiments, fig. 6 is a schematic diagram of a technical link for cutting a three-dimensional home decoration model according to an exemplary embodiment of the present application. As shown in fig. 6, when the electronic device performs three-dimensional trimming, it is necessary to first perform coordinate transformation to transform the object to be trimmed from a first coordinate system of the three-dimensional home model into a second coordinate system in which the sketch plane is located. Then, the electronic device can judge whether the whole cutting body is intersected with the object to be cut, if not, the electronic device can directly output the object to be cut, and if so, the electronic device can execute the subsequent cutting process. The electronic device can traverse each triangular surface, judge whether the current triangular surface intersects with the boundary frame of the sketch outline, if not, the triangular surface can be directly inserted into the target cutting result without cutting processing. If so, the electronic device may further determine whether the triangular surface is perpendicular to the sketch plane and may employ a different three-dimensional cutting pattern based on whether the triangular surface is perpendicular.
Specifically, when the triangular surface is perpendicular to the sketch plane, the electronic device can project the triangular surface into the sketch plane to obtain a line segment to be cut, then the electronic device can subtract the sketch outline from the line segment to be cut to obtain an uncut section, and then subtract the line segment to be cut from the uncut section to obtain a cut section, namely an alternative cut outline; then the electronic equipment can reflect the alternative cutting section to the plane where the triangular surface is located, and stretch the alternative cutting section according to a preset stretching height to obtain a cutting frame; the electronic device can subtract the cutting frame from the triangular surface to obtain the target cutting profile.
When the triangular surface is not perpendicular to the sketch plane, the electronic equipment can project the triangular surface into the sketch plane to obtain the triangular surface to be cut, and then the electronic equipment can subtract the sketch outline from the triangular surface to be cut to obtain an alternative cutting outline; and then the electronic equipment can reflect the alternative cutting profile to the plane of the triangular surface, so that the target cutting profile can be obtained.
After determining the target cutting profile, the electronic device may re-triangulate to obtain a triangular set, and then the electronic device may determine the target cutting result. If the cut three-dimensional home decoration model needs to be subjected to surface complement, the electronic equipment can determine a target surface complement result and add the target surface complement result to a target cutting result; if no face complement is required, the electronic device can skip the face complement process. Finally, the electronic device may output a target trimming result, and display a target three-dimensional home decoration model according to the target trimming result, where the target three-dimensional home decoration model includes a target trimming object.
According to the embodiment of the application, the cutting objects such as a door and window hole and the like in the three-dimensional cutting scene are abstracted into the cutting bodies, the three elements such as a sketch plane, a sketch outline and a stretching height are used for unique expression, the background wall, the wall panel and the like are used as the objects to be cut, and the three-dimensional cutting algorithm based on the cutting bodies converts the cutting calculation in the three-dimensional space into two-dimensional calculation, so that the complexity of the three-dimensional cutting calculation is reduced, the calculation amount of the three-dimensional cutting is reduced, the calculation time is reduced, the method can be applied to the three-dimensional design software, and the use experience of a user is improved.
Fig. 7 is a schematic structural diagram of a cutting device for a three-dimensional home decoration model according to an exemplary embodiment of the present application, and referring to fig. 7, a cutting device 70 for a three-dimensional home decoration model includes:
a first determining module 71, configured to determine an object to be cut and a cutting body in the three-dimensional home decoration model in response to a preset interaction operation of a user on the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces;
a cutting module 72, configured to perform a cutting calculation on the triangle surface based on the sketch contour in the sketch plane, to obtain an alternative cutting contour; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is the plane in which the sketch outline is located;
A second determining module 73, configured to determine, in the three-dimensional home decoration model, a target cutting contour corresponding to the object to be cut based on the alternative cutting contour;
and the display module 74 is used for triangulating the target cutting outline to obtain a target cutting result, and displaying the target cutting object in the target three-dimensional home decoration model according to the target cutting result.
In one possible embodiment, the apparatus 70 is further configured to:
determining conversion parameters between a first coordinate system corresponding to the object to be cut and a second coordinate system corresponding to the sketch plane;
and carrying out coordinate transformation on vertex coordinates corresponding to the vertexes in the object to be cut and vertex normal vectors based on the transformation parameters to obtain the object to be cut under the second coordinate system.
In one possible embodiment, the apparatus 70 is further configured to:
determining a boundary box corresponding to the sketch outline;
if the bounding box is not intersected with the triangular surface in the object to be cut, the triangular surface is directly stored in the target cutting object.
In one possible implementation, the cutting module 72 is specifically configured to:
cutting the triangular surface according to a vertical cutting mode under the condition that the triangular surface is vertical to the sketch plane, so as to obtain an alternative cutting profile;
And under the condition that the triangular surface is not perpendicular to the sketch plane, cutting the triangular surface in a non-perpendicular cutting mode to obtain an alternative cutting profile.
In one possible implementation, the cutting module 72 is specifically configured to:
projecting the triangular surface into a sketch plane to obtain a to-be-cut line section;
and determining the part, overlapping with the sketch outline, of the line segment to be cut, and obtaining an alternative cutting outline.
In one possible implementation, the cutting module 72 is specifically configured to:
reflecting the alternative cutting outline into the plane of the triangular surface, and determining a cutting frame based on the alternative cutting outline and a preset stretching height;
based on the crop box and the triangular face, a target crop profile is determined.
In a possible implementation manner, the second determining module 73 is specifically configured to:
projecting the triangular surface into a sketch plane to obtain a triangular surface to be cut;
and cutting the triangular surface to be cut based on the sketch outline to obtain an alternative cutting outline.
In a possible implementation manner, the second determining module 73 is specifically configured to:
and reflecting the alternative cutting profile to the plane of the triangular surface to obtain the target cutting profile.
In one possible implementation, the display module 74 is specifically configured to:
Processing the target cutting outline based on a preset triangulation algorithm to obtain a triangular surface set;
and determining vertex coordinates, normal vectors and UV values of all vertexes in the triangular surface set to obtain a target cutting result.
In one possible embodiment, the apparatus 70 is further configured to:
determining a target side line corresponding to a target cutting result in a stretching plane corresponding to each side line of the sketch outline;
generating a target plane area contour based on the target edge; the target plane is an area needing to be planar repaired in the object to be cut;
and carrying out triangulation treatment on the outline of the target plane area to obtain a target surface complement result, and adding the target surface complement result into a target cutting result.
The cutting device 70 for the three-dimensional home decoration model provided by the embodiment of the present application can execute the technical scheme shown in the above method embodiment, and its implementation principle and beneficial effects are similar, and will not be described herein.
Fig. 8 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application, referring to fig. 8, the electronic device 80 may include a processor 81 and a memory 82. The processor 81, the memory 82, and the like are illustratively interconnected by a bus 83.
Memory 82 stores computer-executable instructions;
processor 81 executes computer-executable instructions stored in memory 82, causing processor 81 to perform the method of trimming a three-dimensional home model as shown in the method embodiments described above.
Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, for implementing a method for cutting a three-dimensional home model according to the above-described method embodiment when the computer-executable instructions are executed by a processor.
Accordingly, the embodiment of the application also provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, the method for cutting the three-dimensional home decoration model shown in the embodiment of the method can be realized.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors, input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (14)

1. A method for cutting a three-dimensional home decoration model, comprising:
responding to preset interactive operation of a user on a three-dimensional home decoration model, and determining an object to be cut and a cutting body in the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces;
In the sketch plane, cutting calculation is carried out on the triangular surface based on the sketch outline, and an alternative cutting outline is obtained; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is a plane in which the sketch outline is located;
determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour;
and performing triangulation processing on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result.
2. The method according to claim 1, wherein the method further comprises:
determining conversion parameters between a first coordinate system corresponding to the object to be cut and a second coordinate system corresponding to the sketch plane;
and carrying out coordinate transformation on vertex coordinates corresponding to the vertexes in the object to be cut and vertex normal vectors based on the transformation parameters to obtain the object to be cut in a second coordinate system.
3. The method according to claim 1, wherein the method further comprises:
determining a boundary box corresponding to the sketch outline;
if the bounding box is not intersected with the triangular surface in the object to be cut, the triangular surface is directly stored into the target cutting object.
4. The method of claim 1, wherein the cropping the triangle surface based on the sketch profile results in an alternative cropping profile comprising:
cutting the triangular surface according to a vertical cutting mode under the condition that the triangular surface is vertical to the sketch plane, so as to obtain the alternative cutting profile;
and under the condition that the triangular surface is not perpendicular to the sketch plane, cutting the triangular surface in a non-perpendicular cutting mode to obtain the alternative cutting profile.
5. The method of claim 4, wherein said cutting the triangular face in a vertical cut to obtain the alternative cut profile comprises:
projecting the triangular surface into the sketch plane to obtain a to-be-cut line segment;
and determining the part, overlapped with the sketch outline, of the to-be-cut line section to obtain the alternative cutting outline.
6. The method according to claim 5, wherein determining, based on the alternative cutting profile, a target cutting profile corresponding to the object to be cut in a three-dimensional home model comprises:
reflecting the alternative cutting outline into the plane of the triangular surface, and determining a cutting frame based on the alternative cutting outline and a preset stretching height;
The target crop profile is determined based on the crop box and the triangular face.
7. The method of claim 4, wherein the cutting the triangular face in a non-perpendicular cutting manner to obtain the alternative cut profile comprises:
projecting the triangular surface into the sketch plane to obtain a triangular surface to be cut;
and cutting the triangular surface to be cut based on the sketch outline to obtain the alternative cutting outline.
8. The method of claim 7, wherein determining, in a three-dimensional home model, a target trim profile corresponding to the object to be trimmed based on the alternative trim profile, comprises:
and reflecting the alternative cutting profile to the plane of the triangular surface to obtain the target cutting profile.
9. The method of claim 1, wherein triangulating the target cutoff profile to obtain a target cutoff result comprises:
processing the target cutting outline based on a preset triangulation algorithm to obtain a triangular surface set;
and determining vertex coordinates, normal vectors and UV values of all vertexes in the triangular surface set to obtain the target cutting result.
10. The method according to any one of claims 1 to 9, further comprising:
determining a target side line corresponding to the target cutting result in a stretching plane corresponding to each side line of the sketch outline;
generating a target plane area contour based on the target side line; the target plane is an area needing to be subjected to plane repair in the object to be cut;
and carrying out triangulation on the outline of the target plane area to obtain a target surface complement result, and adding the target surface complement result into the target cutting result.
11. A cutting device for a three-dimensional home decoration model, comprising:
the first determining module is used for determining an object to be cut and a cutting body in the three-dimensional home decoration model in response to preset interactive operation of a user on the three-dimensional home decoration model; the object to be cut consists of a plurality of triangular surfaces;
the cutting module is used for carrying out cutting calculation on the triangular surface based on the sketch outline in the sketch plane to obtain an alternative cutting outline; the sketch outline is a basic figure outline corresponding to the cutting body; the sketch plane is a plane in which the sketch outline is located;
The second determining module is used for determining a target cutting contour corresponding to the object to be cut in the three-dimensional home decoration model based on the alternative cutting contour;
and the display module is used for carrying out triangulation processing on the target cutting outline to obtain a target cutting result, and displaying a target cutting object in the target three-dimensional home decoration model according to the target cutting result.
12. An electronic device, comprising: a memory and a processor;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory, causing the processor to perform the method of trimming a three-dimensional home model as claimed in any one of claims 1 to 10.
13. A computer readable storage medium having stored therein computer executable instructions for implementing a method of trimming a three-dimensional house hold model according to any one of claims 1 to 10 when the computer executable instructions are executed by a processor.
14. A computer program product comprising a computer program which, when executed by a computer, implements a method of cutting a three-dimensional home model according to any one of claims 1 to 10.
CN202310682259.8A 2023-06-08 2023-06-08 Cutting method, device and equipment for three-dimensional home decoration model Pending CN116645474A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310682259.8A CN116645474A (en) 2023-06-08 2023-06-08 Cutting method, device and equipment for three-dimensional home decoration model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310682259.8A CN116645474A (en) 2023-06-08 2023-06-08 Cutting method, device and equipment for three-dimensional home decoration model

Publications (1)

Publication Number Publication Date
CN116645474A true CN116645474A (en) 2023-08-25

Family

ID=87618735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310682259.8A Pending CN116645474A (en) 2023-06-08 2023-06-08 Cutting method, device and equipment for three-dimensional home decoration model

Country Status (1)

Country Link
CN (1) CN116645474A (en)

Similar Documents

Publication Publication Date Title
CN112347546A (en) BIM rendering method, device and computer-readable storage medium based on lightweight device
US10916054B2 (en) Three-dimensional mesh deformation using deep learning neural networks
JP2669599B2 (en) Shadow drawing method and three-dimensional graphic computer system
KR102164541B1 (en) Apparatus and method for generating acceleration structure in a ray tracing system
KR102242566B1 (en) Apparatus and method for processing ray tracing
KR20150051477A (en) Apparatus and method for processing ray tracing
KR20140024361A (en) Employing mesh files to animate transitions in client applications
KR20160126329A (en) Method and apparatus for processing a image by performing adaptive sampling
CN111744199B (en) Image processing method and device, computer readable storage medium and electronic equipment
WO2022033009A1 (en) Rendering processing method and apparatus, electronic device and storage medium
US10083264B1 (en) Systems and methods for implicit surface modeling
CN115588077A (en) Method for solving threading of three-dimensional human body model and garment model and electronic equipment
CN114707218A (en) Three-dimensional model simplification method and device
CN110349262B (en) BIM-based three-dimensional modeling method and system for advanced geological prediction of tunnel
CN114429535A (en) Smooth cutting method and device for triangular mesh curved surface
Danilov Unstructured tetrahedral mesh generation technology
CN116645474A (en) Cutting method, device and equipment for three-dimensional home decoration model
CN103020402B (en) Modeling method and modeling device
KR20170048003A (en) Method and apparatus for generating acceleration structure
CN115481268A (en) Parallel line wall data identification method, device, equipment and storage medium
JP2001034653A (en) Feature-type macro language for defining customized analysis function and customized graphic function
Mateo et al. Hierarchical, Dense and Dynamic 3D Reconstruction Based on VDB Data Structure for Robotic Manipulation Tasks
Xin et al. Parallel computing 2D Voronoi diagrams using untransformed sweepcircles
CN112036030B (en) Ore body combination constraint modeling method, device, equipment and storage medium
CN109840945B (en) Finite element preprocessing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination