Method for inferring a 3D geometry onto a 2D sketch
A computer-implemented method for designing at least one 3D model in a 3D scene including receiving a user's 2D sketch and displaying it on a plane, the 2D sketch representing a view of the 3D model to be designed, inferring a 3D primitive based on the 2D sketch, the 3D primitive being oriented and positioned in the 3D scene to match the view, performing a 2D projection of the 3D primitive on the plane, and fitting the 2D projection onto the 2D sketch.
1 . A computer-implemented method for designing at least one 3D model in a 3D scene, comprising:
a) receiving a user's 2D sketch and displaying the 2D sketch on a plane, the 2D sketch representing a view of the 3D model to be designed;
b) inferring a 3D primitive based on the 2D sketch, the 3D primitive being oriented and positioned in the 3D scene to match said view;
c) performing a 2D projection of the 3D primitive on the plane; and
d) fitting said 2D projection onto said 2D sketch,
wherein step d) further comprises:
computing a first 2D bounding square of the 2D projection;
computing a second 2D bounding square of the 2D sketch;
translating the first 2D bounding square in the plane such that a center of the first 2D bounding square and a center of the second 2D bounding square coincide; and
uniformly scaling the first 2D bounding square such that a length of a side of the first 2D bounding square fits a length of the side of the second 2D bounding square.
2 . The computer-implemented method according to claim 1 , wherein, the 2D projection includes at least one edge being a first edge, which fits at least partially onto an edge of the 2D sketch being a second edge, and
wherein the method further comprises:
receiving a user's input which includes selecting the first edge; and
replacing the second edge by the first edge.
3 . The computer-implemented method according to claim 1 , further comprising:
obtaining an edge constraint which fits an edge of the 2D projection;
receiving a second user's sketch at a distance to the edge of the 2D projection which is inferior to a predetermined threshold; and
snapping the second user's sketch to the edge constraint.
4 . The computer-implemented method according to claim 1 , wherein the 2D sketch includes a plurality of strokes, steps a)-d) being iterated after each stroke.
5 . The computer-implemented method according to claim 1 , wherein the 3D primitive is inferred by using a deep learning model, the deep learning model being trained with at least one group of 3D models having common structural or functional features.
6 . The computer-implemented method according to claim 5 , further comprising setting a distance between the plane and the 3D primitive based on a representative size of the 3D models of the group.
7 . A method for designing a set of 3D models, comprising:
designing a first 3D model using the method according to claim 1 ;
designing a second 3D model;
detecting a 3D constraint between the first 3D model and the second 3D model; and
modifying the 3D position or orientation of one among: the first 3D model and the second 3D model based on said 3D constraint,
wherein the first and second 3D model are each designed by:
a) receiving a user's 2D sketch and displaying the 2D sketch on a plane, the 2D sketch representing a view of the 3D model to be designed;
b) inferring a 3D primitive based on the 2D sketch, the 3D primitive being oriented and positioned in a 3D scene to match said view;
c) performing a 2D projection of the 3D primitive on the plane; and
d) fitting said 2D projection onto said 2D sketch.
8 . The method for designing the set of 3D models according to claim 7 , wherein the 3D constraint is at least one among: co-planarity, contact, co-axiality, parallelism, and symmetry.
9 . A non-transitory computer-readable data-storage medium having stored thereon computer-executable instructions that when executed by a computer system cause the computer system to carry out the method according to claim 1 .
10 . The computer-implemented method according to claim 1 , wherein the user's 2D sketch includes at least a first set of strokes and a second set of strokes, and
wherein step d) is implemented for the first set of strokes;
and said method further comprising, for the first set of strokes and for the second set of strokes:
computing a first 2D binary mask of an envelope of the 2D sketch;
computing a second 2D binary mask of an envelope of the 2D projection; and
translating a second 2D binary mask in the plane and uniformly scaling the second 2D binary mask to maximize an overlapping of the first and second 2D binary masks.
11 . A computer-implemented method for designing at least one 3D model in a 3D scene, comprising:
a) receiving a user's 2D sketch and displaying the 2D sketch on a plane, the 2D sketch representing a view of the 3D model to be designed;
b) inferring a 3D primitive based on the 2D sketch, the 3D primitive being oriented and positioned in the 3D scene to match said view;
c) performing a 2D projection of the 3D primitive on the plane; and
d) fitting said 2D projection onto said 2D sketch,
wherein step d) further comprises:
computing a first 2D bounding rectangle of the 2D projection;
computing a second 2D bounding rectangle of the 2D sketch;
translating the first 2D bounding rectangle in the plane such that a center of the first 2D bounding rectangle and a center of the second 2D bounding rectangle coincide; and
uniformly scaling the first 2D bounding rectangle such that a length of one among a long side or short side of the first 2D bounding rectangle fits a length of a corresponding side of the second 2D bounding rectangle.
12 . The computer-implemented method according to claim 11 , wherein the user's 2D sketch includes at least a first set of strokes and a second set of strokes, and
wherein step d) is implemented for the first set of strokes;
and said method further comprising, for the first set of strokes and for the second set of strokes:
computing a first 2D binary mask of an envelope of the 2D sketch;
computing a second 2D binary mask of an envelope of the 2D projection; and
translating a second 2D binary mask in the plane and uniformly scaling the second 2D binary mask to maximize an overlapping of first and second 2D binary masks.
13 . The computer-implemented method according to claim 11 , wherein, the 2D projection includes at least one edge being a first edge, which fits at least partially onto an edge of the 2D sketch being a second edge, and
wherein the method further comprises:
receiving a user's input which includes selecting the first edge; and
replacing the second edge by the first edge.
14 . A computer system comprising:
a processor coupled to a memory, the memory storing computer-executable instructions that when executed by the processor cause the processor to be configured to:
receive a user's 2D sketch and displaying the 2D sketch on a plane, the 2D sketch representing a view of a 3D model to be designed;
infer a 3D primitive based on the 2D sketch, the 3D primitive being oriented and positioned in a 3D scene to match said view;
perform a 2D projection of the 3D primitive on the plane; and
fit said 2D projection onto said 2D sketch,
wherein the processor is further configured to:
compute a first 2D bounding square of the 2D projection;
compute a second 2D bounding square of the 2D sketch;
translate the first 2D bounding square in the plane such that a center of the first 2D bounding square and a center of the second 2D bounding square coincide; and
uniformly scale the first 2D bounding square such that a length of a side of the first 2D bounding square fits a length of the side of the second 2D bounding square.