IUVSurface_DG surface;
//.....
double minU,maxU,minV,maxV;
surface.GetParameterRange(true, out minU, out maxU);
surface.GetParameterRange(false, out minV, out maxV);
double u = minU;
double v = minV;
double du = (maxU-minU)/10;
double dv = (maxV-minV)/20;
for(int i=0;i<10; i++ ) {
for(int j=0;j<20; j++) {
PointDg pnt = surface.GetPoint(new Dg_2D(u, v));
IEntity_DG ent = myModel.AddNewBRepShape(ShapeType_DG.eShTypeVertexDG);
IBRepGeometry_DG geo = (IBRepGeometry_DG)ent.GetGeometry();
IBRepVertex_DG vert = (IBRepVertex_DG)geo.GetShape();
vert.SetPosition1(pnt);
v += dv;
}
u += du; v = minV;
}
I see the points, but they are in wrong place.
What is wrong?
Thank you
If a subset of the points partially lies OK on the surface than you just need to take in consideration the trimming curves of the edge. The actual face uses only part of the parameters range rectangle. The easier way is to do in 2d uv space. You need to check if a uv point lies inside the curved polygon of pcurves. See the IBRepEdge_DG.aspx#GetPCurve(). I do not know a general method for doing this. It might be easier if you know the type of the curves
If points are out of the face completely you are probably missing conversion to global coordinates. surface.GetPoint() returns coordinates relative to the local frame of the entity.