MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031261Open CASCADE[OCCT] OCCT:Modeling Datapublic2019-12-23 12:582020-09-15 12:42
Reportersnn 
Assigned Tomsv 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031261: Modeling Data - Unable to find a closest point on the face section
DescriptionTakes place in the following situation:
1. A face with geometry is crossed by plane
2. It is needed to find a point on the cross-section closest to the specified point
A code fragment is provided.
The attached archive contains shapes of interest (in binary and text formats). Shape names correlate with names from the code fragment.

Steps To ReproduceBRepAlgoAPI_Section mkSection(mindface, toolplane, Standard_False);
mkSection.Approximation(Standard_True);
mkSection.ComputePCurveOn1(Standard_False);
mkSection.ComputePCurveOn2(Standard_False);
mkSection.Build();
if (mkSection.IsDone())
{
  const TopoDS_Shape& section = mkSection.Shape();

  // Find an edge containing the ponsurf-point.
  double mind2(DBL_MAX);
  TopExp_Explorer expl(section, TopAbs_EDGE);
  for (; expl.More(); expl.Next())
  {
    const TopoDS_Edge& edge = TopoDS::Edge(expl.Current());

    double f, l;
    const Handle(Geom_Curve)& curve = BRep_Tool::Curve(edge, f, l);
    if (!curve.IsNull())
    {
      GeomAdaptor_Curve adaptor(curve, f, l);
      Extrema_ExtPC extrema(pontris, adaptor, Precision::Confusion());
      if (extrema.IsDone())
      {
        bool isminfound(false);
        for (int i = 1; i <= extrema.NbExt() && !isminfound; i++)
        {
          if (extrema.IsMin(i))
          {
            double d2 = extrema.SquareDistance(i);
            if (d2 < mind2)
            {
                mind2 = d2;
                isminfound = true;
                sectionedge = edge;
                ponsurf = extrema.Point(i).Value();
            }
          }
        }
      }
    }
  }
  if (mind2 == DBL_MAX)
  {
    // Shapes were saved here
    std::cout << "mind2 == DBL_MAX" << std::endl;
  }
}
TagsNo tags attached.
Test case number
Attached Fileszip file icon shapes.zip (15,078 bytes) 2019-12-23 12:58

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-12-23 12:58 snn New Issue
2019-12-23 12:58 snn Assigned To => msv
2019-12-23 12:58 snn File Added: shapes.zip
2020-09-15 12:42 msv Target Version 7.5.0 => 7.6.0*
2020-09-15 12:42 msv Summary Unable to find a closest point on the face section => Modeling Data - Unable to find a closest point on the face section


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker