mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0031688: Visualization - Wrong ISO lines for a face created from BSpline
Added a check to see if the ISO line intersects the bounding contour.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <StdPrs_Isolines.hxx>
|
||||
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <Bnd_Range.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <GCPnts_AbscissaPoint.hxx>
|
||||
@@ -479,6 +480,24 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa
|
||||
}
|
||||
}
|
||||
|
||||
// re-calculate UV-range basing on p-curves tessellation
|
||||
Bnd_Range aTrimU, aTrimV;
|
||||
for (Standard_Integer anI = 1; anI <= aTrimPoints.Length(); ++anI)
|
||||
{
|
||||
const gp_Pnt2d& aTrimPnt = aTrimPoints.Value (anI);
|
||||
aTrimU.Add (aTrimPnt.X());
|
||||
aTrimV.Add (aTrimPnt.Y());
|
||||
}
|
||||
// ignore p-curves tessellation under sampler deflection - it might clamp range
|
||||
if (!aTrimU.IsVoid() && aTrimU.Delta() <= aSamplerDeflection)
|
||||
{
|
||||
aTrimU.SetVoid();
|
||||
}
|
||||
if (!aTrimV.IsVoid() && aTrimV.Delta() <= aSamplerDeflection)
|
||||
{
|
||||
aTrimV.SetVoid();
|
||||
}
|
||||
|
||||
// Compute a hatching tolerance.
|
||||
aHatchingTolerance *= 0.1;
|
||||
aHatchingTolerance = Max (Precision::Confusion(), aHatchingTolerance);
|
||||
@@ -489,11 +508,21 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa
|
||||
|
||||
for (Standard_Integer anIso = 1; anIso <= theUIsoParams.Length(); ++anIso)
|
||||
{
|
||||
aHatcher.AddXLine (theUIsoParams.Value (anIso));
|
||||
const Standard_Real anIsoParamU = theUIsoParams.Value (anIso);
|
||||
if (aTrimU.IsVoid()
|
||||
|| !aTrimU.IsOut (anIsoParamU))
|
||||
{
|
||||
aHatcher.AddXLine (anIsoParamU);
|
||||
}
|
||||
}
|
||||
for (Standard_Integer anIso = 1; anIso <= theVIsoParams.Length(); ++anIso)
|
||||
{
|
||||
aHatcher.AddYLine (theVIsoParams.Value (anIso));
|
||||
const Standard_Real anIsoParamV = theVIsoParams.Value (anIso);
|
||||
if (aTrimV.IsVoid()
|
||||
|| !aTrimV.IsOut (anIsoParamV))
|
||||
{
|
||||
aHatcher.AddYLine (anIsoParamV);
|
||||
}
|
||||
}
|
||||
|
||||
// Trim hatching region.
|
||||
|
@@ -39,6 +39,15 @@ StdPrs_ToolRFace::StdPrs_ToolRFace (const Handle(BRepAdaptor_HSurface)& theSurfa
|
||||
myFace.Orientation(TopAbs_FORWARD);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Edge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Edge& StdPrs_ToolRFace::Edge() const
|
||||
{
|
||||
return TopoDS::Edge (myExplorer.Current());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : next
|
||||
//purpose :
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
class BRepAdaptor_HSurface;
|
||||
class TopoDS_Edge;
|
||||
|
||||
//! Iterator over 2D curves restricting a face (skipping internal/external edges).
|
||||
//! In addition, the algorithm skips NULL curves - IsInvalidGeometry() can be checked if this should be handled within algorithm.
|
||||
@@ -64,6 +65,9 @@ public:
|
||||
//! Return current curve.
|
||||
const Adaptor2d_Curve2d& Value() const { return myCurve; }
|
||||
|
||||
//! Return current edge.
|
||||
Standard_EXPORT const TopoDS_Edge& Edge() const;
|
||||
|
||||
//! Return current edge orientation.
|
||||
TopAbs_Orientation Orientation() const { return myExplorer.Current().Orientation(); }
|
||||
|
||||
|
Reference in New Issue
Block a user