mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +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:
parent
9df0497931
commit
0e57793fc6
@ -16,6 +16,7 @@
|
|||||||
#include <StdPrs_Isolines.hxx>
|
#include <StdPrs_Isolines.hxx>
|
||||||
|
|
||||||
#include <Adaptor3d_IsoCurve.hxx>
|
#include <Adaptor3d_IsoCurve.hxx>
|
||||||
|
#include <Bnd_Range.hxx>
|
||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <GCPnts_AbscissaPoint.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.
|
// Compute a hatching tolerance.
|
||||||
aHatchingTolerance *= 0.1;
|
aHatchingTolerance *= 0.1;
|
||||||
aHatchingTolerance = Max (Precision::Confusion(), aHatchingTolerance);
|
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)
|
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)
|
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.
|
// Trim hatching region.
|
||||||
|
@ -39,6 +39,15 @@ StdPrs_ToolRFace::StdPrs_ToolRFace (const Handle(BRepAdaptor_HSurface)& theSurfa
|
|||||||
myFace.Orientation(TopAbs_FORWARD);
|
myFace.Orientation(TopAbs_FORWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Edge
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopoDS_Edge& StdPrs_ToolRFace::Edge() const
|
||||||
|
{
|
||||||
|
return TopoDS::Edge (myExplorer.Current());
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : next
|
//function : next
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <Geom2dAdaptor_Curve.hxx>
|
#include <Geom2dAdaptor_Curve.hxx>
|
||||||
#include <TopAbs_Orientation.hxx>
|
#include <TopAbs_Orientation.hxx>
|
||||||
class BRepAdaptor_HSurface;
|
class BRepAdaptor_HSurface;
|
||||||
|
class TopoDS_Edge;
|
||||||
|
|
||||||
//! Iterator over 2D curves restricting a face (skipping internal/external edges).
|
//! 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.
|
//! 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.
|
//! Return current curve.
|
||||||
const Adaptor2d_Curve2d& Value() const { return myCurve; }
|
const Adaptor2d_Curve2d& Value() const { return myCurve; }
|
||||||
|
|
||||||
|
//! Return current edge.
|
||||||
|
Standard_EXPORT const TopoDS_Edge& Edge() const;
|
||||||
|
|
||||||
//! Return current edge orientation.
|
//! Return current edge orientation.
|
||||||
TopAbs_Orientation Orientation() const { return myExplorer.Current().Orientation(); }
|
TopAbs_Orientation Orientation() const { return myExplorer.Current().Orientation(); }
|
||||||
|
|
||||||
|
22
tests/bugs/vis/bug31688
Normal file
22
tests/bugs/vis/bug31688
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0031688: Visualization - Wrong ISO lines for a face created from BSpline"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
pbsplinecurve aa 2 4 0 1 1 1 2 1 3 1 0 0 0 1 1 2 0 1 2 0 0 1
|
||||||
|
mkedge ee aa
|
||||||
|
wire ww ee
|
||||||
|
mkplane ff ww
|
||||||
|
vinit
|
||||||
|
vdisplay ff
|
||||||
|
visos ff 50 50 1
|
||||||
|
vfit
|
||||||
|
|
||||||
|
if { [vreadpixel 365 200 -rgb -name] != "BLACK" ||
|
||||||
|
[vreadpixel 366 200 -rgb -name] != "BLACK" ||
|
||||||
|
[vreadpixel 367 200 -rgb -name] != "BLACK" } {
|
||||||
|
puts "Error: isolines are not expected here"
|
||||||
|
}
|
||||||
|
|
||||||
|
vdump ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user