#include <StdPrs_Isolines.hxx>
#include <Adaptor3d_IsoCurve.hxx>
+#include <Bnd_Range.hxx>
#include <BRepTools.hxx>
#include <BRep_Tool.hxx>
#include <GCPnts_AbscissaPoint.hxx>
}
}
+ // 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);
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.
myFace.Orientation(TopAbs_FORWARD);
}
+//=======================================================================
+//function : Edge
+//purpose :
+//=======================================================================
+const TopoDS_Edge& StdPrs_ToolRFace::Edge() const
+{
+ return TopoDS::Edge (myExplorer.Current());
+}
+
//=======================================================================
//function : next
//purpose :
#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.
//! 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(); }
--- /dev/null
+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