Problem with surface sampling
Posted: Thu May 06, 2021 5:57 am
Hello
I need help.
I wrote a program which reads step file. I need to display it.
I tried to sample points from a selected surface.
I see the points, but they are in wrong place.
What is wrong?
Thank you
I need help.
I wrote a program which reads step file. I need to display it.
I tried to sample points from a selected surface.
Code: Select all
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;
}
What is wrong?
Thank you