View Issue Details

IDProjectCategoryView StatusLast Update
0030336CommunityOCCT:Data Exchangepublic2018-11-02 17:48
Reporterventu Assigned Togka 
PrioritynormalSeveritymajor 
Status newResolutionopen 
Product Version7.3.0 
Summary0030336: Missing surfaces when importing STeP file due to wrong NURBS surface continuity detection
DescriptionThis problem is very similar to 0029345.

The attached is imported with several surfaces missing.
The reason is:
_ some NURBS surface has multiple internal knots, so it is marked as GeomAbs_C0 without any check on whether this is really the case;
_ then an offset is made which refuses to work on C0 surfaces;
_ so the face is discarded.

Those surfaces are not really C0, but no check is made to see if the derivatives are continuous at the knots with mutiplicity=degree.
Additional information
and documentation updates
Below is some code which, added at the end of Geom_BSplineSurface::Geom_BSplineSurface, fixes this particular case.
Notice I don't deem it as production ready, since it uses fixed arbitrary tolerances and I don't know if it can have any side effect.



  if (Usmooth==GeomAbs_C0) {
    GeomAbs_Shape OldVsmooth=Vsmooth;
    Vsmooth=GeomAbs_C1;
    bool Continue=true;
    try {
      for (Standard_Integer i=2;i<NbUKnots()&&Continue;++i)
        if (UMultiplicity(i)>=udeg) {
          Standard_Real t=UKnot(i),delta=.00001,t1,t2;
          while (true) {
            t1=t-delta; t2=t+delta;
            if (t1<t&&t2>t) break;
            delta*=10.;
          }
          for (Standard_Integer j=1;j<=NbVKnots()&&Continue;++j) {
            Standard_Real k=VKnot(j);
            gp_Pnt P; gp_Vec D1Ul,D1Ur,D1V;
            D1(t1,k,P,D1Ul,D1V); D1(t2,k,P,D1Ur,D1V);
            Standard_Real Angle=D1Ul.Angle(D1Ur);
            if (Angle>M_PI/360) //Tolleranza di mezzo grado (arbitraria)
              Continue=false;
          }
        }
    } catch (...) {Continue=false;}
    Vsmooth=OldVsmooth;
    if (Continue) Usmooth=GeomAbs_C1;
  }
  if (Vsmooth==GeomAbs_C0) {
    GeomAbs_Shape OldUsmooth=Usmooth;
    Usmooth=GeomAbs_C1;
    bool Continue=true;
    try {
      for (Standard_Integer i=2;i<NbVKnots()&&Continue;++i)
        if (VMultiplicity(i)>=vdeg) {
          Standard_Real t=VKnot(i),delta=.00001,t1,t2;
          while (true) {
            t1=t-delta; t2=t+delta;
            if (t1<t&&t2>t) break;
            delta*=10.;
          }
          for (Standard_Integer j=1;j<=NbUKnots()&&Continue;++j) {
            Standard_Real k=UKnot(j);
            gp_Pnt P; gp_Vec D1U,D1Vl,D1Vr;
            D1(k,t1,P,D1U,D1Vl); D1(k,t2,P,D1U,D1Vr);
            Standard_Real Angle=D1Vl.Angle(D1Vr);
            if (Angle>M_PI/360) //Tolleranza di mezzo grado (arbitraria)
              Continue=false;
          }
        }
    } catch (...) {Continue=false;}
    Usmooth=OldUsmooth;
    if (Continue) Vsmooth=GeomAbs_C1;
  }
TagsNo tags attached.
Test case number

Attached Files

  • 311.zip (2,730,213 bytes)

Activities

ventu

2018-11-02 17:48

reporter  

311.zip (2,730,213 bytes)

Issue History

Date Modified Username Field Change
2018-11-02 17:48 ventu New Issue
2018-11-02 17:48 ventu Assigned To => gka
2018-11-02 17:48 ventu File Added: 311.zip