Mon, 07/29/2019 - 15:18
I have some requirement to develop a program using NURBS surface, so I need to transfer data into OCCT
there are 9 input parameters for the construction function of Geom_BSplineSurface class, they are
const TColgp_Array2OfPnt& Poles,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults,
const TColStd_Array1OfInteger& VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean UPeriodic,
const Standard_Boolean VPeriodic
Degree and Periodic are simple, Degree is an positive integer, Periodic is bool.
I know the meaning of the other variables, but I don't knwo the data structure of them, can anybody clarify them for me?
Poles are control points, for surface, it's 2D array, in Poles[i][j], what is it? Is dimension 1 for U direction or dimension 2 for U direction? if any figure, it'll be much more clear
KNots are knots, usually it's between 0 and 1, 0 for the start point and 1 for the end point. it's is the same dimension as Poles? if the start point of the Spline is the same as the first control point, the first Degree+1 KNots should be all 0, similarly the same of the last point and the last control points needs the last Degree+1 KNots to be 1. In "The NURBS Book" chapter3 equation 3.2, it's clearly defined, the length of KNots array are longer than Poles array, unless the use doesn't need the overlay of the first and the last control points to the spline points.
so the following concern is the Mults. what's its data structure? multi overlay knots would lead the spline close to the specific control point, if the multi level is more than Degree, it would collapse to an un-continue point. how do you define the data stucture in it?
now I have control points data and knots data, I want to construct a Geom_BSplineSurface, how should I organize my data to match OCCT data structure? can anybody clarify it for me?
Tue, 07/30/2019 - 09:57
I cannot answer your question, but for creation of B-Spline surfaces there exists also the helper class GeomAPI_PointsToBSplineSurface. Maybe you want to have a look at it.
Benjamin
Mon, 10/28/2019 - 15:19
I'll copy (part of) some code I wrote a little while back to create a Geom_BSplineSurface from my own data.
I would have to spend some more time looking through stuff to remember the specifics. For example, I am not 100% sure anymore why the first and last multiplicity needed to be increased by one. But essentially, different people sometimes use (slightly) different data structures to represent nurbs. In my code, for example, it appears OCC uses a smaller array of unique knot values and a separate array of multiplicities. Others just use a single array with multiple duplicate knot values.
Maybe it helps a bit though