Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030336Community[OCCT] OCCT:Data Exchangepublic2018-11-02 17:482018-11-02 17:48
Assigned Togka 
PlatformOSOS Version
Product Version[OCCT] 7.3.0 
Target VersionFixed in Version 
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;
    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;
          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)
    } catch (...) {Continue=false;}
    if (Continue) Usmooth=GeomAbs_C1;
  if (Vsmooth==GeomAbs_C0) {
    GeomAbs_Shape OldUsmooth=Usmooth;
    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;
          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)
    } catch (...) {Continue=false;}
    if (Continue) Vsmooth=GeomAbs_C1;
TagsNo tags attached.
Test case number
Attached Fileszip file icon (2,730,213 bytes) 2018-11-02 17:48

- Relationships

-  Notes
There are no notes attached to this issue.

- 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:

Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker