CN109360266A - A kind of road modeling method, relevant apparatus and equipment - Google Patents

A kind of road modeling method, relevant apparatus and equipment Download PDF

Info

Publication number
CN109360266A
CN109360266A CN201811102002.6A CN201811102002A CN109360266A CN 109360266 A CN109360266 A CN 109360266A CN 201811102002 A CN201811102002 A CN 201811102002A CN 109360266 A CN109360266 A CN 109360266A
Authority
CN
China
Prior art keywords
curve
dimensional
coordinate
point
coordinate points
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
CN201811102002.6A
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.)
SHENZHEN CHUANGMENG TIANDI TECHNOLOGY CO LTD
Original Assignee
SHENZHEN CHUANGMENG TIANDI 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 SHENZHEN CHUANGMENG TIANDI TECHNOLOGY CO LTD filed Critical SHENZHEN CHUANGMENG TIANDI TECHNOLOGY CO LTD
Priority to CN201811102002.6A priority Critical patent/CN109360266A/en
Publication of CN109360266A publication Critical patent/CN109360266A/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

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention discloses a kind of road modeling method, relevant apparatus and equipment, this method comprises: building two-dimensional curve, the two-dimensional curve is the curve in three-dimensional system of coordinate XYZ in XOY plane coordinate system;The three-dimensional curve in Z axis coordinate value building three-dimensional system of coordinate XYZ is added in each two-dimensional coordinate point on the two-dimensional curve;Using the three-dimensional curve as center axis, and the width of the three-dimensional curve is expanded in the positive and negative direction of normal at any point on the three-dimensional curve, generates three-dimensional traverse.Using the embodiment of the present invention, road model can be more efficiently constructed, the road model reusability built is high.

Description

A kind of road modeling method, relevant apparatus and equipment
Technical field
The present invention relates to field of computer technology more particularly to a kind of road modeling methods, relevant apparatus and equipment.
Background technique
In many application fields, such as architectural design, urban planning, virtual city, virtual living scene, scene of game are all It needs to use three-dimensional modeling, human and material resources can be saved by simulating threedimensional model with simulation software.Traditional three-dimensional artificial modeling The ratio of the threedimensional model of building, length, width and height has been fixed, and if there is one is changed, must repaint entire mould Type, cause building model reusability it is low, building model low efficiency.For example, may be related in scene of game building process And to needing to construct road, in the prior art, most game industry will use 3D modeling software building road, and 3D is built For mould software when constructing road model due to being that portion three-dimensional picture pasting is directly added within a grid to carry out building model, portion three-dimensional picture pasting is one Three-dimensional model, is made of, it is therefore desirable to be laid out one by one to a large amount of point, line, surface, to each a large amount of point, line, surface Parameter in point, line, surface will be adjusted one by one, be operated sufficiently complex, when non-professional user removes building 3D road model, Modeling efficiency is low, when in portion three-dimensional picture pasting a certain line or some face need to change when, it is necessary to adjust in portion three-dimensional picture pasting Each point, line, surface, reusability is low.
Summary of the invention
The embodiment of the present invention provide a kind of road modeling method, a kind of road modeling device, a kind of road modeling equipment, with And a kind of computer readable storage medium, to improve the technical issues of constructing road model efficiency and reusability.
In order to solve the above-mentioned technical problem, first aspect of the embodiment of the present invention discloses one kind and is directed to road modeling method, Include:
Two-dimensional curve is constructed, the two-dimensional curve is the curve in three-dimensional system of coordinate XYZ in XOY plane coordinate system;
Three in Z axis coordinate value building three-dimensional system of coordinate XYZ are added in each two-dimensional coordinate point on the two-dimensional curve Dimension curve;
Using the three-dimensional curve as center axis, and the positive and negative direction of normal at any point on the three-dimensional curve The width of the three-dimensional curve is expanded, three-dimensional traverse is generated.
Optionally, the building two-dimensional curve includes:
N is determined on XOY plane coordinate system1A orderly coordinate points P (n), wherein the n1A coordinate points are not at one On straight line, n1For the integer greater than 2;
By the n1The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve1It is a The tangent line of coordinate points;
According to the n1The tangent line of a coordinate points calculates n described in first curve1The curvature of a coordinate points;
Pass through the smooth n of Gaussian function1The curvature of a coordinate points obtains the two-dimensional curve;
Optionally, the building two-dimensional curve further include:
The first data acquisition system in database is called to construct the two-dimensional curve, first data acquisition system includes n2It is a Two-dimensional coordinate point in XOY plane coordinate system, the n2The curve that a two-dimensional coordinate point is constituted is smoothed curve, wherein n2It is big In 2 integer;
Optionally, described that Z axis coordinate value building three-dimensional coordinate is added in each two-dimensional coordinate point on the two-dimensional curve It is the three-dimensional curve in XYZ, comprising:
Determine the second curve in an XOY plane coordinate system, n-th on second curve3A coordinate points with it is described N-th on two-dimensional curve3Coordinate value of a coordinate points in X-axis is identical, wherein n3For natural number;
Z axis coordinate value is added to coordinate points on the two-dimensional curve using coordinate value of second curve in Y-axis, with Construct the three-dimensional curve in the three-dimensional system of coordinate XYZ, wherein n-th on second curve3The Y-coordinate value of a coordinate points is N-th on the two-dimensional curve3The Z axis coordinate value that a coordinate points are added;Optionally, described will be every on the two-dimensional curve The three-dimensional curve in Z axis coordinate value building three-dimensional system of coordinate XYZ is added in one two-dimensional coordinate point, comprising:
Determine the third curve in an XOY plane coordinate system, n-th on the third curve4A coordinate points with it is described N-th on three-dimensional curve4Coordinate value of a coordinate points in X-axis is identical, wherein n4For natural number;
Using coordinate value of the third curve in Y-axis to the positive and negative side of the normal of any point on the three-dimensional curve To the width for expanding the three-dimensional curve, three-dimensional traverse is generated, wherein n-th on the three-dimensional curve4At a coordinate points Width value is by the altitude curve n-th4The Y-coordinate value of a coordinate points determines;
Multiple three-dimensional traverses of generation are subjected to head and the tail splicing, and adjacent three-dimensional traverse is docked Part is smooth to horizontal plane, constitutes adjacent three-dimensional traverse.
Optionally, the part that adjacent three-dimensional traverse is docked is smooth to horizontal plane and includes:
By previous threedimensional model the last one point consecutive points Level Change be and the last one put height it is consistent, So that the ending tangent line of previous threedimensional model is kept in the horizontal plane;
It is consistent with the height of first point by the Level Change of the consecutive points of first point of the latter threedimensional model, so that The beginning direction of the latter threedimensional model is kept in the horizontal plane.
Second aspect of the embodiment of the present invention discloses a kind of road modeling device, including executing the side such as above-mentioned first aspect The unit of method.
The third aspect of the embodiment of the present invention discloses a kind of road modeling equipment, including processor, input equipment, output are set Standby and memory, the processor, input equipment, output equipment and memory are connected with each other, wherein the memory is for depositing Application code is stored up, the processor is configured for calling said program code, execute as described in above-mentioned first aspect Method.
Fourth aspect of the embodiment of the present invention discloses a kind of computer readable storage medium, and the computer storage medium is deposited Computer program is contained, the computer program includes program instruction, and described program instruction makes described when being executed by a processor Processor executes the method such as above-mentioned first aspect.
Implement the embodiment of the present invention, drafting two-dimensional curve can be passed through and height parameter and width parameter is added to construct three The road model of dimension does not need that a large amount of point, line, surface in threedimensional model are drawn and are arranged respectively, easy to operate, mentions Rise user experience.Further, it when any one place needs to change in used model length, does not need to mould Be adjusted simultaneously at length three in type, also do not need to repaint model, it is only necessary to two-dimensional curve, it is wide, at high one It is adjusted, reusability is high, high-efficient.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Wherein:
Fig. 1 is a kind of schematic flow diagram of road modeling method provided in an embodiment of the present invention;
Fig. 2 is n determining on XOY plane coordinate system provided in an embodiment of the present invention1A orderly coordinate points P (n) signal Figure;
Fig. 3 is the first curve synoptic diagram on XOY plane coordinate system provided in an embodiment of the present invention;
Fig. 4 is two-dimensional curve schematic diagram on XOY plane coordinate system provided in an embodiment of the present invention;
Fig. 5 is that two-dimensional curve according to designated length splits into n on XOY plane coordinate system provided in an embodiment of the present invention2It is a Point schematic diagram;
Fig. 6 is the second curve synoptic diagram on XOY plane coordinate system provided in an embodiment of the present invention;
Fig. 7 is that XYZ three-dimensional coordinate provided in an embodiment of the present invention fastens three-dimensional curve schematic diagram;
Fig. 8 is third curve synoptic diagram on XOY plane coordinate system provided in an embodiment of the present invention;
Fig. 9 is that XYZ three-dimensional coordinate provided in an embodiment of the present invention fastens three-dimensional traverse schematic diagram;
Figure 10 is the structural schematic diagram of road modeling device provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram of road modeling equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
In the specific implementation, the method for road modeling described in the embodiment of the present invention can be by mobile phone, desktop computer, above-knee meter Calculation machine, wearable device etc. have drawing, the terminal device of modeling function is realized, are not construed as limiting herein.To the embodiment of the present invention Be described by executing subject of terminal device, it should be appreciated that terminal may include such as physical keyboard, mouse and/or One or more of the other physical user-interface device of control-rod.
The embodiment of the present invention provides a kind of road modeling method, comprising: building two-dimensional curve, the two-dimensional curve are three-dimensional Curve in coordinate system XYZ in XOY plane coordinate system;Z axis coordinate is added in each two-dimensional coordinate point on the two-dimensional curve Three-dimensional curve in value building three-dimensional system of coordinate XYZ;Using the three-dimensional curve as center axis, and on the three-dimensional curve The width of the three-dimensional curve is expanded in the positive and negative direction of the normal at any point, generates three-dimensional traverse.It carries out individually below detailed Thin description.
A kind of road modeling method, road modeling device and road that embodiment provides in order to better understand the present invention The process of modelling apparatus, a kind of road modeling method being first applicable in below the embodiment of the present invention is described.Referring to Fig. 1, Fig. 1 is the flow diagram of road modeling method provided in an embodiment of the present invention, the road modeling method in the embodiment of the present invention Include:
Step S101, two-dimensional curve is constructed, the two-dimensional curve is in XOY plane coordinate system in three-dimensional system of coordinate XYZ Curve.
Specifically, two-dimensional curve can be constructed according to function (such as: SIN function, cosine function), it can also basis Some two-dimensional coordinate points construct two-dimensional curve, it should be noted that the two-dimensional curve of building is not limited to two in XOY plane Dimension curve, the two-dimensional curve being also possible in any one plane of XOZ, YOZ.
In one possible implementation, the building two-dimensional curve specifically includes: determining on XOY plane coordinate system n1A orderly coordinate points P (n1), wherein the n1A coordinate points not point-blank, n1For the integer greater than 2;It please refers to Fig. 2, Fig. 2 are n determining on XOY plane coordinate system provided in an embodiment of the present invention1A orderly coordinate points P (n1) schematic diagram, it needs It is noted that n1A orderly coordinate points P (n1) it can be the curve for forming arbitrary shape, it is not limited to n in Fig. 21It is a orderly Coordinate points P (n1) composition curve form;
By the n1The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve1It is a The tangent line of coordinate points, referring to Fig. 3, Fig. 3 is the first curve synoptic diagram on XOY plane coordinate system provided in an embodiment of the present invention.
According to the n1The tangent line of a coordinate points calculates n described in first curve1The curvature of a coordinate points, P (n1) Tangent line is expressed as Pt (n1):
Pt(n1)=normalize (P (n1+1)-P(n1))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n1) curvature be expressed as Pc (n1):
cross(Pt(n1),Pt(n1+ 1) when) >=0, Pc (n1)=angle (Pt (n1),Pt(n1+1))
cross(Pt(n1),Pt(n1+ 1) when) < 0, Pc (n1)=- angle (Pt (n1),Pt(n1+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function1Curvature Pc (the n of a coordinate points1), obtain the two-dimensional curve:
In formula, Pgw (n1) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n1) it is smoothed out curvature, b is adjustable Save coefficient, smoothed out curvature Pc'(n1) corresponding curve is the two-dimensional curve, referring to Fig. 4, Fig. 4 is implementation of the present invention Two-dimensional curve schematic diagram on the XOY plane coordinate system that example provides.It should be noted that above-mentioned curve smoothing method is not limited to height This function smoothing algorithm can be improved Gaussian function smoothing algorithm, linearly fall for method, segmental cubic polynomials interpolation method (also known as five-spot), quadratic polynomial weighted mean method, Tensive Spline Function method etc., herein without limitation.The embodiment of the present invention, Be linked to be curve using described point, by the point retouched uses curve smoothing algorithm to carry out that smoothly, arbitrary shape can be obtained to curve again Two-dimensional curve, the two-dimensional curve drawn also can satisfy the requirement of different road models, and smoothed two-dimensional curve is also forced Nearly real-life curved road, is more able to satisfy user demand, promotes user experience.
In one possible implementation, the building two-dimensional curve specifically includes: calling the first number in database The two-dimensional curve is constructed according to set, first data acquisition system includes n2Two-dimensional coordinate point in a XOY plane coordinate system, institute State n2The curve that a two-dimensional coordinate point is constituted is smoothed curve, wherein n2For the integer greater than 2, referring to Fig. 5, Fig. 5 is the present invention Two-dimensional curve splits into n according to designated length on the XOY plane coordinate system that embodiment provides2A schematic diagram, n after fractionation2A point Coordinate be stored in first database, can indicate the information such as shape, the length of a smoothed curve.It should be noted that The first data acquisition system can be developer according to data usage frequency in the database, can construct frequency of use is high The data of two-dimensional curve, which store, constitutes the first data acquisition system, can also be saved the data for the two-dimensional curve drawn with user Get off the first data acquisition system of building.If the two-dimensional curve that user needs has data in the database, can directly adjust With can save and to calculate curvature, smoothed curve, efficiency can be improved, promote user experience.
Step S102, Z axis coordinate value is added in each two-dimensional coordinate point on the two-dimensional curve and constructs three-dimensional system of coordinate Three-dimensional curve in XYZ.
Specifically, height parameter is added in the two-dimensional curve constructed in above-mentioned steps S101 to construct three-dimensional system of coordinate Three-dimensional curve in XYZ.It should be noted that described be added height parameter to two-dimensional curve, can be on two-dimensional curve Height parameter is individually added in each point, is also possible to be segmented two-dimensional curve addition height parameter, herein without limitation.
In one possible implementation, described that Z axis seat is added in each two-dimensional coordinate point on the two-dimensional curve Three-dimensional curve in scale value building three-dimensional system of coordinate XYZ specifically includes: determine the second curve in an XOY plane coordinate system, N-th on second curve3N-th in a coordinate points and the two-dimensional curve3Coordinate value of a coordinate points in X-axis is identical, Wherein, n3For natural number, referring to Fig. 6, Fig. 6 is that second curve is illustrated on XOY plane coordinate system provided in an embodiment of the present invention Figure, it should be noted that second curve can be the curve of arbitrary shape, the curve shape being not limited in Fig. 6;
Z axis coordinate value is added to coordinate points on the two-dimensional curve using coordinate value of second curve in Y-axis, with Construct the three-dimensional curve in the three-dimensional system of coordinate XYZ, wherein n-th on second curve3The Y-coordinate value of a coordinate points is N-th on the two-dimensional curve3The Z axis coordinate value that a coordinate points are added is referring to Fig. 7, Fig. 7 is that the embodiment of the present invention mentions The XYZ three-dimensional coordinate of confession fastens three-dimensional curve schematic diagram, it should be noted that the three-dimensional curve is in the XOY plane coordinate That fastens is projected as the two-dimensional curve.
Optionally, second curve includes:
N is determined on XOY plane coordinate system3A orderly coordinate points P (n3), wherein the n3A coordinate points are not at one On straight line, n3For the integer greater than 2;
By the n3The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve3It is a The tangent line of coordinate points;
According to the n3The tangent line of a coordinate points calculates n described in first curve3The curvature of a coordinate points, P (n3) Tangent line is expressed as Pt (n3):
Pt(n3)=normalize (P (n3+1)-P(n3))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n3) curvature be expressed as Pc (n3):
cross(Pt(n3),Pt(n3+ 1) when) >=0, Pc (n3)=angle (Pt (n3),Pt(n3+1))
cross(Pt(n3),Pt(n3+ 1) when) < 0, Pc (n3)=- angle (Pt (n3),Pt(n3+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function3Curvature Pc (the n of a coordinate points3), obtain second curve:
In formula, Pgw (n3) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n3) it is smoothed out curvature, b is adjustable Save coefficient, smoothed out curvature Pc'(n3) corresponding curve is second curve.It should be noted that above-mentioned curve smoothing Method is not limited to Gaussian function smoothing algorithm, can be improved Gaussian function smoothing algorithm, linearly fall for method, segmentation it is more three times Item formula interpolation method (also known as five-spot), quadratic polynomial weighted mean method, Tensive Spline Function method etc., herein without limitation.
Optionally, the second curve includes:
The second data set in database is called to construct second curve, the second data set includes n3It is a Anchor point coordinate in two-dimensional coordinate point and anchor point in XOY plane coordinate system or so tangent line, the n3In a two-dimensional coordinate point The curve that anchor point coordinate and anchor point or so tangent line are constituted is smoothed curve, wherein n3For the integer greater than 2.It should be noted that The second data set can be developer according to data usage frequency, and the high data of frequency of use are stored the of composition Two data acquisition systems are also possible to the second data set that used data are preserved composition by user in use. It if the second curve that user needs has data in the database, can call directly, can save and calculate curvature, smooth Curve and etc., efficiency can be improved, promote user experience.
Step S103, using the three-dimensional curve as center axis, and the normal at any point on the three-dimensional curve The width of the three-dimensional curve is expanded in positive and negative direction, generates three-dimensional traverse.
Specifically, the three-dimensional curve constructed in above-mentioned steps S102 is expanded into width to the positive and negative direction of normal to generate three Road model is tieed up, can be and different width is expanded to each point on three-dimensional curve, identical width can also be expanded, It can be and identical direction is expanded to the positive and negative direction of the normal of one section of three-dimensional curve to specified point, specified point can be described three First point on dimension curve is also possible to the last one point, can also be selected on three-dimensional curve according to demand it is any One point.
In one possible implementation, described using the three-dimensional curve as center axis, and to the three-dimensional curve On the positive and negative direction of normal of any point expand the width of the three-dimensional curve, generate three-dimensional traverse and specifically include: determining Third curve in one XOY plane coordinate system, n-th on the third curve4In a coordinate points and the three-dimensional curve N-th4Coordinate value of a coordinate points in X-axis is identical, wherein n4For natural number, referring to Fig. 8, Fig. 8 is that the embodiment of the present invention mentions Third curve synoptic diagram on the XOY plane coordinate system of confession, it should be noted that the third curve can be the song of arbitrary shape Line, the curve shape being not limited in Fig. 8;
Using coordinate value of the third curve in Y-axis to the positive and negative side of the normal of any point on the three-dimensional curve To the width for expanding the three-dimensional curve, three-dimensional traverse is generated, wherein n-th on the three-dimensional curve4At a coordinate points Width value is by the altitude curve n-th4The Y-coordinate value of a coordinate points determines, referring to Fig. 9, Fig. 9 is that the embodiment of the present invention mentions The XYZ three-dimensional coordinate of confession fastens three-dimensional traverse schematic diagram.
Optionally, the third curve includes:
N is determined on XOY plane coordinate system4A orderly coordinate points P (n4), wherein the n4A coordinate points are not at one On straight line, n4For the integer greater than 2;
By the n4The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve4It is a The tangent line of coordinate points;
According to the n4The tangent line of a coordinate points calculates n described in first curve4The curvature of a coordinate points, P (n4) Tangent line is expressed as Pt (n4):
Pt(n4)=normalize (P (n4+1)-P(n4))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n4) curvature be expressed as Pc (n4):
cross(Pt(n4),Pt(n4+ 1) when) >=0, Pc (n4)=angle (Pt (n4),Pt(n4+1))
cross(Pt(n4),Pt(n4+ 1) when) < 0, Pc (n4)=- angle (Pt (n4),Pt(n4+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function4Curvature Pc (the n of a coordinate points4), obtain second curve:
In formula, Pgw (n4) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n4) it is smoothed out curvature, b is adjustable Save coefficient, smoothed out curvature Pc'(n4) corresponding curve is the third curve.It should be noted that above-mentioned curve smoothing Method is not limited to Gaussian function smoothing algorithm, can be improved Gaussian function smoothing algorithm, linearly fall for method, segmentation it is more three times Item formula interpolation method (also known as five-spot), quadratic polynomial weighted mean method, Tensive Spline Function method etc., herein without limitation.
Optionally, third curve includes:
The third data acquisition system in database is called to construct the third curve, the third data acquisition system includes n4It is a Anchor point coordinate in two-dimensional coordinate point and anchor point in XOY plane coordinate system or so tangent line, the n4In a two-dimensional coordinate point The curve that anchor point coordinate and anchor point or so tangent line are constituted is smoothed curve, wherein n4For the integer greater than 2.It should be noted that Third data acquisition system can be developer according to data usage frequency, and the high data of frequency of use are stored the of composition Two data acquisition systems are also possible to the third data acquisition system that used data are preserved composition by user in use. It if the third curve that user needs has data in the database, can call directly, can save and calculate curvature, smooth Curve and etc., efficiency can be improved, promote user experience.
Optionally, described using the three-dimensional curve as center axis, and the normal of any point on the three-dimensional curve The width of the three-dimensional curve is expanded in positive and negative direction, generates three-dimensional traverse further include: by multiple three-dimensional roads of generation Road model carries out head and the tail splicing, and the part that adjacent three-dimensional traverse docks is smooth to horizontal plane, constitutes adjacent three Tie up road model.
In one possible implementation, the part that adjacent three-dimensional traverse is docked is smooth to horizontal plane Specifically include: by previous threedimensional model the last one point consecutive points Level Change be and the last one point height one It causes, so that the ending tangent line of previous threedimensional model is kept in the horizontal plane;By the adjacent of first point of the latter threedimensional model Point Level Change be it is consistent with the height of first point so that the beginning direction of the latter threedimensional model is maintained at horizontal plane On.Spliced in the horizontal plane, can be inconsistent to avoid the adjacent three-dimensional traverse direction spliced, so as to avoid The case where offset cumulative formation in direction is similar to roller-coaster road.
Through the embodiment of the present invention, it when any one place needs to change in used model length, is not required to Not need to repaint model to being adjusted simultaneously at length three in model yet, it is only necessary to two-dimensional curve, width, It is adjusted at high one, reusability is high, high-efficient.The road modeling method provided in the present embodiment can be by drawing two dimension Height parameter and width parameter is added to construct three-dimensional road model in curve, do not need in threedimensional model a large amount of point, Line, face are drawn and are arranged respectively, easy to operate, promote user experience.
The structural schematic diagram of road modeling device provided in an embodiment of the present invention as shown in Figure 10, road modeling device can To include: construction unit 100, adding unit 102 and generation unit 104, wherein
Construction unit 100, for constructing two-dimensional curve, the two-dimensional curve is XOY plane coordinate in three-dimensional system of coordinate XYZ Curve in system;
Adding unit 102, it is three-dimensional for the building of Z axis coordinate value to be added in each two-dimensional coordinate point on the two-dimensional curve Three-dimensional curve in coordinate system XYZ;
Generation unit 104 is used for using the three-dimensional curve as center axis, and any point on the three-dimensional curve The positive and negative direction of normal expand the width of the three-dimensional curve, generate three-dimensional traverse.
Optionally, construction unit 100 are specifically used for determining n on XOY plane coordinate system1A orderly coordinate points P (n1), Wherein, the n1A coordinate points not point-blank, n1For the integer greater than 2;By the n1A orderly coordinate points are in order The first curve is connected into, n described in first curve is calculated1The tangent line of a coordinate points, according to the n1The tangent line of a coordinate points Calculate n described in first curve1The curvature of a coordinate points, P (n1) tangent line be expressed as Pt (n1):
Pt(n1)=normalize (P (n1+1)-P(n1))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n1) curvature be expressed as Pc (n1):
cross(Pt(n1),Pt(n1+ 1) when) >=0, Pc (n1)=angle (Pt (n1),Pt(n1+1))
cross(Pt(n1),Pt(n1+ 1) when) < 0, Pc (n1)=- angle (Pt (n1),Pt(n1+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function1Curvature Pc (the n of a coordinate points1), obtain the two-dimensional curve:
In formula, Pgw (n1) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n1) it is smoothed out curvature, b is adjustable Save coefficient.
Optionally, construction unit 100 can be also used for calling the first data acquisition system building two dimension in database bent Line, first data acquisition system includes n2Two-dimensional coordinate point in a XOY plane coordinate system, the n2A two-dimensional coordinate point is constituted Curve be smoothed curve, wherein n2For the integer greater than 2.
Optionally, adding unit 102, the second curve being specifically determined in an XOY plane coordinate system are described N-th on second curve3N-th in a coordinate points and the two-dimensional curve3Coordinate value of a coordinate points in X-axis is identical, In, n3For natural number;Z axis is added to coordinate points on the two-dimensional curve using coordinate value of second curve in Y-axis to sit Scale value, to construct the three-dimensional curve in the three-dimensional system of coordinate XYZ.
N is determined on XOY plane coordinate system3A orderly coordinate points P (n3), wherein the n3A coordinate points are not at one On straight line, n3For the integer greater than 2.
By the n3The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve3It is a The tangent line of coordinate points;According to the n3The tangent line of a coordinate points calculates n described in first curve3The curvature of a coordinate points, P (n3) tangent line be expressed as Pt (n3):
Pt(n3)=normalize (P (n3+1)-P(n3))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n3) curvature be expressed as Pc (n3):
cross(Pt(n3),Pt(n3+ 1) when) >=0, Pc (n3)=angle (Pt (n3),Pt(n3+1))
cross(Pt(n3),Pt(n3+ 1) when) < 0, Pc (n3)=- angle (Pt (n3),Pt(n3+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function3Curvature Pc (the n of a coordinate points3), obtain second curve:
In formula, Pgw (n3) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n3) it is smoothed out curvature, b is adjustable Save coefficient.
Optionally, adding unit 102 can be also used for calling the second data set building described second in database bent Line, the second data set include n3Anchor point coordinate in two-dimensional coordinate point and anchor point in a XOY plane coordinate system or so Tangent line, the n3The curve that anchor point coordinate and anchor point in a two-dimensional coordinate point or so tangent line are constituted is smoothed curve, wherein n3For Integer greater than 2.
Optionally, generation unit 104, the third curve being determined in an XOY plane coordinate system, the third N-th on curve4N-th in a coordinate points and the three-dimensional curve4Coordinate value of a coordinate points in X-axis is identical, wherein n4 For natural number.
Using coordinate value of the third curve in Y-axis to the positive and negative side of the normal of any point on the three-dimensional curve To the width for expanding the three-dimensional curve, three-dimensional traverse is generated.
N is determined on XOY plane coordinate system4A orderly coordinate points P (n4), wherein the n4A coordinate points are not at one On straight line, n4For the integer greater than 2;
By the n4The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve4It is a The tangent line of coordinate points;According to the n4The tangent line of a coordinate points calculates n described in first curve4The curvature of a coordinate points, P (n4) tangent line be expressed as Pt (n4):
Pt(n4)=normalize (P (n4+1)-P(n4))
In formula, normalize function is vector normalized function, for being unit vector by tangent line normalizing;
P(n4) curvature be expressed as Pc (n4):
cross(Pt(n4),Pt(n4+ 1) when) >=0, Pc (n4)=angle (Pt (n4),Pt(n4+1))
cross(Pt(n4),Pt(n4+ 1) when) < 0, Pc (n4)=- angle (Pt (n4),Pt(n4+1))
In formula, angle function calculates the angle of tangent line, and cross function calculates the direction of tangent line;
Pass through the smooth n of Gaussian function4Curvature Pc (the n of a coordinate points4), obtain second curve:
In formula, Pgw (n4) it is Gaussian smoothing weight, a is adjustable coefficient, Pc'(n4) it is smoothed out curvature, b is adjustable Save coefficient.
Optionally, generation unit 104 can be also used for calling the third data acquisition system in database to construct the third bent Line, the third data acquisition system includes n4Anchor point coordinate in two-dimensional coordinate point and anchor point in a XOY plane coordinate system or so Tangent line, the n4The curve that anchor point coordinate and anchor point in a two-dimensional coordinate point or so tangent line are constituted is smoothed curve, wherein n4For Integer greater than 2.
Optionally, generation unit 104, the multiple three-dimensional traverses that can be also used for generate carry out head and the tail spelling It connects, and the part that adjacent three-dimensional traverse docks is smooth to horizontal plane, constitute adjacent three-dimensional traverse.
By previous threedimensional model the last one point consecutive points Level Change be and the last one put height it is consistent, So that the ending tangent line of previous threedimensional model is kept in the horizontal plane;By the consecutive points of first point of the latter threedimensional model Level Change is consistent with the height of first point, so that the beginning direction of the latter threedimensional model is kept in the horizontal plane.
It should be noted that the road modeling device 10 in the embodiment of the present invention is road of the above-mentioned Fig. 1 into Fig. 9 embodiment Road model building device, the function of each module can be corresponded to reference to Fig. 1 to Fig. 9 in above-mentioned each method embodiment in the road modeling device 10 The specific implementation of embodiment, which is not described herein again.
For the ease of better implementing the above scheme of the embodiment of the present invention, the present invention is also corresponding to be provided a kind of road and builds Mould equipment is described in detail with reference to the accompanying drawing:
The structural schematic diagram of road modeling equipment provided in an embodiment of the present invention as shown in Figure 11, road modeling equipment 110 may include processor 1101, input unit 1102, output unit 1103, memory 1104 and communication unit 1105, processing Device 1101, input unit 1102, output unit 1103, memory 1104 and communication unit 1105 can be mutual by bus 1106 Connection.Memory 1104 can be high speed RAM memory, be also possible to non-volatile memory (non-volatile Memory), a for example, at least magnetic disk storage.Memory 1104 optionally can also be that at least one is located remotely from aforementioned place Manage the storage system of device 1101.Memory 1104 may include operating system, network communication mould for storing application code Block, Subscriber Interface Module SIM and road modeling program, communication unit 1105 are used to carry out information exchange with external unit;Processor 1101 are configured for calling said program code, execute following steps:
Pass through the input of input unit 1102 n on XOY plane coordinate system1A orderly coordinate points P (n1), by the n1It is a The first curve is linked in sequence into orderly coordinate points;
N described in first curve is calculated by processor 1101 again1The tangent line of a coordinate points, according to the n1A seat The tangent line of punctuate calculates n described in first curve1The curvature of a coordinate points passes through the smooth n of Gaussian function1A coordinate Curvature Pc (the n of point1), obtain the two-dimensional curve;The two-dimensional curve is in XOY plane coordinate system in three-dimensional system of coordinate XYZ Curve;
The three-dimensional in Z axis coordinate value building three-dimensional system of coordinate XYZ is added in each two-dimensional coordinate point on the two-dimensional curve Curve;
For using the three-dimensional curve as center axis, and the normal at any point on the three-dimensional curve is positive and negative The width of the three-dimensional curve is expanded in direction, generates three-dimensional traverse.
It should be noted that the road modeling equipment 110 in the embodiment of the present invention is above-mentioned Fig. 1 into Fig. 9 embodiment Road modeling equipment can specifically correspond to the specific implementation with reference to Fig. 1 in above-mentioned each method embodiment to Fig. 9 embodiment, this In repeat no more.The above-mentioned structure for road modeling equipment 110 is only an example provided in an embodiment of the present invention, also, Road modeling equipment 110 can have components more more or fewer than the component shown, can combine two or more components, or Person can have the different configurations of component to realize.
Implement the embodiment of the present invention, height is added using the two-dimensional curve of building, road model can be constructed by expanding width, Easy to operate, modeling efficiency is high, when place any one in used model length is improper, it is only necessary to two-dimentional bent Line, it is wide, be adjusted at high one, reusability is high.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (10)

1. a kind of road modeling method characterized by comprising
Two-dimensional curve is constructed, the two-dimensional curve is the curve in three-dimensional system of coordinate XYZ in XOY plane coordinate system;
The three-dimensional that each two-dimensional coordinate point on the two-dimensional curve is added in Z axis coordinate value building three-dimensional system of coordinate XYZ is bent Line;
Using the three-dimensional curve as center axis, and the positive and negative direction of normal at any point on the three-dimensional curve is expanded The width of the three-dimensional curve generates three-dimensional traverse.
2. the method according to claim 1, wherein the building two-dimensional curve includes:
N is determined on XOY plane coordinate system1A orderly coordinate points P (n1), wherein the n1A coordinate points are not in straight line On, n1For the integer greater than 2;
By the n1The first curve is linked in sequence into a orderly coordinate points, calculates n described in first curve1A coordinate The tangent line of point;
According to the n1The tangent line of a coordinate points calculates n described in first curve1The curvature of a coordinate points;
Pass through the smooth n of Gaussian function1The curvature of a coordinate points obtains the two-dimensional curve.
3. the method according to claim 1, wherein the building two-dimensional curve includes:
The first data acquisition system in database is called to construct the two-dimensional curve, first data acquisition system includes n2A XOY plane Two-dimensional coordinate point in coordinate system, the n2The curve that a two-dimensional coordinate point is constituted is smoothed curve, wherein n2It is whole greater than 2 Number.
4. the method according to claim 1, wherein described by each two-dimensional coordinate point on the two-dimensional curve The three-dimensional curve in Z axis coordinate value building three-dimensional system of coordinate XYZ is added, comprising:
Determine the second curve in an XOY plane coordinate system, n-th on second curve3A coordinate points and the two dimension are bent N-th on line3Coordinate value of a coordinate points in X-axis is identical, wherein n3For natural number;
Z axis coordinate value is added to coordinate points on the two-dimensional curve using coordinate value of second curve in Y-axis, with building Three-dimensional curve in the three-dimensional system of coordinate XYZ, wherein n-th on second curve3The Y-coordinate value of a coordinate points is described N-th on two-dimensional curve3The Z axis coordinate value that a coordinate points are added.
5. the method according to claim 1, wherein described using the three-dimensional curve as center axis, and to institute The width of the three-dimensional curve is expanded in the positive and negative direction of normal for stating any point on three-dimensional curve, generates three-dimensional traverse, packet It includes:
Determine the third curve in an XOY plane coordinate system, n-th on the third curve4A coordinate points and the three-dimensional song N-th on line4Coordinate value of a coordinate points in X-axis is identical, wherein n4For natural number;
The positive and negative direction of the normal of any point on the three-dimensional curve is opened up using coordinate value of the third curve in Y-axis The width of three-dimensional curve described in exhibition generates three-dimensional traverse, wherein n-th on the three-dimensional curve4Width at a coordinate points Value is by the altitude curve n-th4The Y-coordinate value of a coordinate points determines.
6. the method as described in claim 1, which is characterized in that the method also includes:
Multiple three-dimensional traverses of generation are subjected to head and the tail splicing, and the part that adjacent three-dimensional traverse is docked It is smooth to horizontal plane, constitutes adjacent three-dimensional traverse.
7. method as claimed in claim 6, which is characterized in that the part for docking adjacent three-dimensional traverse is smooth Include: to horizontal plane
By previous threedimensional model the last one point consecutive points Level Change be and the last one put height it is consistent so that The ending tangent line of previous threedimensional model is kept in the horizontal plane;
By the Level Change of the consecutive points of first point of the latter threedimensional model be it is consistent with the height of first point so that latter The beginning direction of a threedimensional model is kept in the horizontal plane.
8. a kind of road modeling device, which is characterized in that including for executing the method according to claim 1 to 7 Unit.
9. a kind of road modeling equipment, which is characterized in that including processor, input equipment, output equipment and memory, the place It manages device, input equipment, output equipment and memory to be connected with each other, wherein the memory is for storing application code, institute It states processor to be configured for calling said program code, executes the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer storage medium is stored with computer program, The computer program includes program instruction, and described program instruction makes the processor execute such as right when being executed by a processor It is required that the described in any item methods of 1-7.
CN201811102002.6A 2018-09-20 2018-09-20 A kind of road modeling method, relevant apparatus and equipment Pending CN109360266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811102002.6A CN109360266A (en) 2018-09-20 2018-09-20 A kind of road modeling method, relevant apparatus and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811102002.6A CN109360266A (en) 2018-09-20 2018-09-20 A kind of road modeling method, relevant apparatus and equipment

Publications (1)

Publication Number Publication Date
CN109360266A true CN109360266A (en) 2019-02-19

Family

ID=65351111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811102002.6A Pending CN109360266A (en) 2018-09-20 2018-09-20 A kind of road modeling method, relevant apparatus and equipment

Country Status (1)

Country Link
CN (1) CN109360266A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110689598A (en) * 2019-04-08 2020-01-14 北京嘀嘀无限科技发展有限公司 Three-dimensional modeling method and system for multilayer road
CN111063035A (en) * 2019-11-22 2020-04-24 同济大学 Three-dimensional visualization method and device for OD relationship in GIS
CN113144595A (en) * 2021-04-23 2021-07-23 腾讯科技(深圳)有限公司 Virtual road generation method, device, terminal and storage medium
CN114863025A (en) * 2022-05-18 2022-08-05 禾多科技(北京)有限公司 Three-dimensional lane line generation method and device, electronic device and computer readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617174A (en) * 2004-12-09 2005-05-18 上海交通大学 Human limb three-dimensional model building method based on image cutline
US20080049046A1 (en) * 2006-05-04 2008-02-28 Inus Technology, Inc. Method for detecting two dimensional sketch data from source model data for three dimensional reverse modeling
CN106503345A (en) * 2016-10-25 2017-03-15 浙江理工大学 A kind of indigo printing fabric Ridge tracing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1617174A (en) * 2004-12-09 2005-05-18 上海交通大学 Human limb three-dimensional model building method based on image cutline
US20080049046A1 (en) * 2006-05-04 2008-02-28 Inus Technology, Inc. Method for detecting two dimensional sketch data from source model data for three dimensional reverse modeling
CN106503345A (en) * 2016-10-25 2017-03-15 浙江理工大学 A kind of indigo printing fabric Ridge tracing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
顾平;许家英;: "基于3DS MAX软件平台织物结构的三维模拟", 丝绸, no. 11, pages 41 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110689598A (en) * 2019-04-08 2020-01-14 北京嘀嘀无限科技发展有限公司 Three-dimensional modeling method and system for multilayer road
CN110689598B (en) * 2019-04-08 2020-10-02 滴图(北京)科技有限公司 Three-dimensional modeling method and system for multilayer road
CN111063035A (en) * 2019-11-22 2020-04-24 同济大学 Three-dimensional visualization method and device for OD relationship in GIS
CN111063035B (en) * 2019-11-22 2021-09-03 同济大学 Three-dimensional visualization method and device for OD relationship in GIS
CN113144595A (en) * 2021-04-23 2021-07-23 腾讯科技(深圳)有限公司 Virtual road generation method, device, terminal and storage medium
CN113144595B (en) * 2021-04-23 2022-07-26 腾讯科技(深圳)有限公司 Virtual road generation method, device, terminal and storage medium
CN114863025A (en) * 2022-05-18 2022-08-05 禾多科技(北京)有限公司 Three-dimensional lane line generation method and device, electronic device and computer readable medium
CN114863025B (en) * 2022-05-18 2023-03-10 禾多科技(北京)有限公司 Three-dimensional lane line generation method and device, electronic device and computer readable medium

Similar Documents

Publication Publication Date Title
CN109360266A (en) A kind of road modeling method, relevant apparatus and equipment
Müller et al. Fast Simulation of Inextensible Hair and Fur.
CN109146808B (en) Portrait beauty method and system
Fang et al. Guaranteed globally injective 3D deformation processing
CN104239601A (en) Simulation of an assembly of fabric pieces
US8538737B2 (en) Curve editing with physical simulation of mass points and spring forces
CN111862291B (en) Baking method and device for water system, storage medium, and electronic device
CN103559374A (en) Method for subdividing surface split type curved surfaces on multi-submesh model
CN113827965B (en) Rendering method, device and equipment of sample lines in game scene
CN108379841B (en) Game special effect processing method and device and terminal
CN111915710A (en) Building rendering method based on real-time rendering technology
JP2002520750A (en) Numerical calculation method of parameterized surface in eigenspace of subdivision matrix of irregular patch
CN109697748A (en) Model compression processing method, model pinup picture processing method device, storage medium
CN103218852A (en) Three-dimensional grid model framework extraction system facing skinned animation based on grid shrink and framework extraction method
CN106327566A (en) Method for generating virtual-reality three dimensional road
Ota et al. 1/f/sup/spl beta//noise-based real-time animation of trees swaying in wind fields
CN106919584A (en) The layout method and device of a kind of topological diagram
EP2413288A2 (en) Collison free construction of animated feathers
Golubev et al. Dijkstra-based terrain generation using advanced weight functions
Nuić et al. Algorithms for procedural generation and display of trees
CN108694300A (en) A kind of method that finite element submodel automatically generates
CN115618628A (en) Cloth simulation driven 3D model construction method, system, medium and equipment
CN111862324B (en) Baking method and device for water system, storage medium, and electronic device
US10902675B2 (en) Graphical modelling by smoothing polyhedral meshes with multi-sided patches
CN104537704A (en) Real-time dynamic generating method for features on bird body model

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190219

RJ01 Rejection of invention patent application after publication