Open CASCADE Technology
7.3.1.dev

Complements standard tool Geom_Surface by providing additional functionality for detection surface singularities, checking spatial surface closure and computing projections of 3D points onto a surface. More...
#include <ShapeAnalysis_Surface.hxx>
Public Member Functions  
ShapeAnalysis_Surface (const Handle< Geom_Surface > &S)  
Creates an analyzer object on the basis of existing surface. More...  
void  Init (const Handle< Geom_Surface > &S) 
Loads existing surface. More...  
void  Init (const Handle< ShapeAnalysis_Surface > &other) 
Reads all the data from another Surface, without recomputing. More...  
void  SetDomain (const Standard_Real U1, const Standard_Real U2, const Standard_Real V1, const Standard_Real V2) 
const Handle< Geom_Surface > &  Surface () const 
Returns a surface being analyzed. More...  
const Handle< GeomAdaptor_HSurface > &  Adaptor3d () 
Returns the Adaptor. Creates it if not yet done. More...  
const Handle< GeomAdaptor_HSurface > &  TrueAdaptor3d () const 
Returns the Adaptor (may be Null if method Adaptor() was not called) More...  
Standard_Real  Gap () const 
Returns 3D distance found by one of the following methods. IsDegenerated, DegeneratedValues, ProjectDegenerated (distance between 3D point and found or last (if not found) singularity), IsUClosed, IsVClosed (minimum value of precision to consider the surface to be closed), ValueOfUV (distance between 3D point and found solution). More...  
gp_Pnt  Value (const Standard_Real u, const Standard_Real v) 
Returns a 3D point specified by parameters in surface parametrical space. More...  
gp_Pnt  Value (const gp_Pnt2d &p2d) 
Returns a 3d point specified by a point in surface parametrical space. More...  
Standard_Boolean  HasSingularities (const Standard_Real preci) 
Returns True if the surface has singularities for the given precision (i.e. if there are surface singularities with sizes not greater than precision). More...  
Standard_Integer  NbSingularities (const Standard_Real preci) 
Returns the number of singularities for the given precision (i.e. number of surface singularities with sizes not greater than precision). More...  
Standard_Boolean  Singularity (const Standard_Integer num, Standard_Real &preci, gp_Pnt &P3d, gp_Pnt2d &firstP2d, gp_Pnt2d &lastP2d, Standard_Real &firstpar, Standard_Real &lastpar, Standard_Boolean &uisodeg) 
Returns the characteristics of the singularity specified by its rank number <num>. That means, that it is not neccessary for <num> to be in the range [1, NbSingularities] but must be not greater than possible (see ComputeSingularities). The returned characteristics are: preci: the smallest precision with which the isoline is considered as degenerated, P3d: 3D point of singularity (middle point of the surface isoline), firstP2d and lastP2d: first and last 2D points of the isoline in parametrical surface, firstpar and lastpar: first and last parameters of the isoline in parametrical surface, uisodeg: if the degenerated isoline is Uiso (True) or Viso (False). Returns False if <num> is out of range, else returns True. More...  
Standard_Boolean  IsDegenerated (const gp_Pnt &P3d, const Standard_Real preci) 
Returns True if there is at least one surface boundary which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci> More...  
Standard_Boolean  DegeneratedValues (const gp_Pnt &P3d, const Standard_Real preci, gp_Pnt2d &firstP2d, gp_Pnt2d &lastP2d, Standard_Real &firstpar, Standard_Real &lastpar, const Standard_Boolean forward=Standard_True) 
Returns True if there is at least one surface isoline which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci> (like IsDegenerated). Returns characteristics of the first found boundary matching those criteria. More...  
Standard_Boolean  ProjectDegenerated (const gp_Pnt &P3d, const Standard_Real preci, const gp_Pnt2d &neighbour, gp_Pnt2d &result) 
Projects a point <P3d> on a singularity by computing one of the coordinates of preliminary computed <result>. More...  
Standard_Boolean  ProjectDegenerated (const Standard_Integer nbrPnt, const TColgp_SequenceOfPnt &points, TColgp_SequenceOfPnt2d &pnt2d, const Standard_Real preci, const Standard_Boolean direct) 
Checks points at the beginning (direct is True) or end (direct is False) of array <points> to lie in singularity of surface, and if yes, adjusts the indeterminate 2d coordinate of these points by nearest point which is not in singularity. Returns True if some points were adjusted. More...  
Standard_Boolean  IsDegenerated (const gp_Pnt2d &p2d1, const gp_Pnt2d &p2d2, const Standard_Real tol, const Standard_Real ratio) 
Returns True if straight pcurve going from point p2d1 to p2d2 is degenerate, i.e. lies in the singularity of the surface. NOTE: it uses another method of detecting singularity than used by ComputeSingularities() et al.! For that, maximums of distances between points p2d1, p2d2 and 0.5*(p2d1+p2d2) and between corresponding 3d points are computed. The pcurve (p2d1, p2d2) is considered as degenerate if: More...  
void  Bounds (Standard_Real &ufirst, Standard_Real &ulast, Standard_Real &vfirst, Standard_Real &vlast) const 
Returns the bounds of the surface (from Bounds from Surface, but buffered) More...  
void  ComputeBoundIsos () 
Computes bound isos (protected against exceptions) More...  
Handle< Geom_Curve >  UIso (const Standard_Real U) 
Returns a UIso. Null if not possible or failed Remark : bound isos are buffered. More...  
Handle< Geom_Curve >  VIso (const Standard_Real V) 
Returns a VIso. Null if not possible or failed Remark : bound isos are buffered. More...  
Standard_Boolean  IsUClosed (const Standard_Real preci=1) 
Tells if the Surface is spatially closed in U with given precision. If <preci> < 0 then Precision::Confusion is used. If Geom_Surface says that the surface is Uclosed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances: More...  
Standard_Boolean  IsVClosed (const Standard_Real preci=1) 
Tells if the Surface is spatially closed in V with given precision. If <preci> < 0 then Precision::Confusion is used. If Geom_Surface says that the surface is Vclosed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances: More...  
gp_Pnt2d  ValueOfUV (const gp_Pnt &P3D, const Standard_Real preci) 
Computes the parameters in the surface parametrical space of 3D point. The result is parameters of the point projected onto the surface. This method enhances functionality provided by the standard tool GeomAPI_ProjectPointOnSurface by treatment of cases when the projected point is near to the surface boundaries and when this standard tool fails. More...  
gp_Pnt2d  NextValueOfUV (const gp_Pnt2d &p2dPrev, const gp_Pnt &P3D, const Standard_Real preci, const Standard_Real maxpreci=1.0) 
Projects a point P3D on the surface. Does the same thing as ValueOfUV but tries to optimize computations by taking into account previous point <p2dPrev>: makes a step by UV and tries Newton algorithm. If <maxpreci> >0. and distance between solution and P3D is greater than <maxpreci>, that solution is considered as bad, and ValueOfUV() is used. If not succeded, calls ValueOfUV() More...  
Standard_Real  UVFromIso (const gp_Pnt &P3D, const Standard_Real preci, Standard_Real &U, Standard_Real &V) 
Tries a refinement of an already computed couple (U,V) by using projecting 3D point on isolines: More...  
Standard_Real  UCloseVal () const 
Returns minimum value to consider the surface as Uclosed. More...  
Standard_Real  VCloseVal () const 
Returns minimum value to consider the surface as Vclosed. More...  
const Bnd_Box &  GetBoxUF () 
const Bnd_Box &  GetBoxUL () 
const Bnd_Box &  GetBoxVF () 
const Bnd_Box &  GetBoxVL () 
Public Member Functions inherited from Standard_Transient  
Standard_Transient ()  
Empty constructor. More...  
Standard_Transient (const Standard_Transient &)  
Copy constructor – does nothing. More...  
Standard_Transient &  operator= (const Standard_Transient &) 
Assignment operator, needed to avoid copying reference counter. More...  
virtual  ~Standard_Transient () 
Destructor must be virtual. More...  
virtual void  Delete () const 
Memory deallocator for transient classes. More...  
virtual const opencascade::handle< Standard_Type > &  DynamicType () const 
Returns a type descriptor about this object. More...  
Standard_Boolean  IsInstance (const opencascade::handle< Standard_Type > &theType) const 
Returns a true value if this is an instance of Type. More...  
Standard_Boolean  IsInstance (const Standard_CString theTypeName) const 
Returns a true value if this is an instance of TypeName. More...  
Standard_Boolean  IsKind (const opencascade::handle< Standard_Type > &theType) const 
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...  
Standard_Boolean  IsKind (const Standard_CString theTypeName) const 
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...  
Standard_Transient *  This () const 
Returns nonconst pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...  
Standard_Integer  GetRefCount () const 
Get the reference counter of this object. More...  
void  IncrementRefCounter () const 
Increments the reference counter of this object. More...  
Standard_Integer  DecrementRefCounter () const 
Decrements the reference counter of this object; returns the decremented value. More...  
Additional Inherited Members  
Public Types inherited from Standard_Transient  
typedef void  base_type 
Returns a type descriptor about this object. More...  
Static Public Member Functions inherited from Standard_Transient  
static const char *  get_type_name () 
Returns a type descriptor about this object. More...  
static const opencascade::handle< Standard_Type > &  get_type_descriptor () 
Returns type descriptor of Standard_Transient class. More...  
Complements standard tool Geom_Surface by providing additional functionality for detection surface singularities, checking spatial surface closure and computing projections of 3D points onto a surface.
This tool is optimised: computes most information only once
ShapeAnalysis_Surface::ShapeAnalysis_Surface  (  const Handle< Geom_Surface > &  S  ) 
Creates an analyzer object on the basis of existing surface.
const Handle< GeomAdaptor_HSurface >& ShapeAnalysis_Surface::Adaptor3d  (  ) 
Returns the Adaptor. Creates it if not yet done.
void ShapeAnalysis_Surface::Bounds  (  Standard_Real &  ufirst, 
Standard_Real &  ulast,  
Standard_Real &  vfirst,  
Standard_Real &  vlast  
)  const 
Returns the bounds of the surface (from Bounds from Surface, but buffered)
void ShapeAnalysis_Surface::ComputeBoundIsos  (  ) 
Computes bound isos (protected against exceptions)
Standard_Boolean ShapeAnalysis_Surface::DegeneratedValues  (  const gp_Pnt &  P3d, 
const Standard_Real  preci,  
gp_Pnt2d &  firstP2d,  
gp_Pnt2d &  lastP2d,  
Standard_Real &  firstpar,  
Standard_Real &  lastpar,  
const Standard_Boolean  forward = Standard_True 

) 
Returns True if there is at least one surface isoline which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci> (like IsDegenerated). Returns characteristics of the first found boundary matching those criteria.
Standard_Real ShapeAnalysis_Surface::Gap  (  )  const 
Returns 3D distance found by one of the following methods. IsDegenerated, DegeneratedValues, ProjectDegenerated (distance between 3D point and found or last (if not found) singularity), IsUClosed, IsVClosed (minimum value of precision to consider the surface to be closed), ValueOfUV (distance between 3D point and found solution).
const Bnd_Box& ShapeAnalysis_Surface::GetBoxUF  (  ) 
const Bnd_Box& ShapeAnalysis_Surface::GetBoxUL  (  ) 
const Bnd_Box& ShapeAnalysis_Surface::GetBoxVF  (  ) 
const Bnd_Box& ShapeAnalysis_Surface::GetBoxVL  (  ) 
Standard_Boolean ShapeAnalysis_Surface::HasSingularities  (  const Standard_Real  preci  ) 
Returns True if the surface has singularities for the given precision (i.e. if there are surface singularities with sizes not greater than precision).
void ShapeAnalysis_Surface::Init  (  const Handle< Geom_Surface > &  S  ) 
Loads existing surface.
void ShapeAnalysis_Surface::Init  (  const Handle< ShapeAnalysis_Surface > &  other  ) 
Reads all the data from another Surface, without recomputing.
Standard_Boolean ShapeAnalysis_Surface::IsDegenerated  (  const gp_Pnt &  P3d, 
const Standard_Real  preci  
) 
Returns True if there is at least one surface boundary which is considered as degenerated with <preci> and distance between P3d and corresponding singular point is less than <preci>
Standard_Boolean ShapeAnalysis_Surface::IsDegenerated  (  const gp_Pnt2d &  p2d1, 
const gp_Pnt2d &  p2d2,  
const Standard_Real  tol,  
const Standard_Real  ratio  
) 
Returns True if straight pcurve going from point p2d1 to p2d2 is degenerate, i.e. lies in the singularity of the surface. NOTE: it uses another method of detecting singularity than used by ComputeSingularities() et al.! For that, maximums of distances between points p2d1, p2d2 and 0.5*(p2d1+p2d2) and between corresponding 3d points are computed. The pcurve (p2d1, p2d2) is considered as degenerate if:
Standard_Boolean ShapeAnalysis_Surface::IsUClosed  (  const Standard_Real  preci = 1  ) 
Tells if the Surface is spatially closed in U with given precision. If <preci> < 0 then Precision::Confusion is used. If Geom_Surface says that the surface is Uclosed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances:
Standard_Boolean ShapeAnalysis_Surface::IsVClosed  (  const Standard_Real  preci = 1  ) 
Tells if the Surface is spatially closed in V with given precision. If <preci> < 0 then Precision::Confusion is used. If Geom_Surface says that the surface is Vclosed, this method also says this. Otherwise additional analysis is performed, comparing given precision with the following distances:
Standard_Integer ShapeAnalysis_Surface::NbSingularities  (  const Standard_Real  preci  ) 
Returns the number of singularities for the given precision (i.e. number of surface singularities with sizes not greater than precision).
gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV  (  const gp_Pnt2d &  p2dPrev, 
const gp_Pnt &  P3D,  
const Standard_Real  preci,  
const Standard_Real  maxpreci = 1.0 

) 
Projects a point P3D on the surface. Does the same thing as ValueOfUV but tries to optimize computations by taking into account previous point <p2dPrev>: makes a step by UV and tries Newton algorithm. If <maxpreci> >0. and distance between solution and P3D is greater than <maxpreci>, that solution is considered as bad, and ValueOfUV() is used. If not succeded, calls ValueOfUV()
Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated  (  const gp_Pnt &  P3d, 
const Standard_Real  preci,  
const gp_Pnt2d &  neighbour,  
gp_Pnt2d &  result  
) 
Projects a point <P3d> on a singularity by computing one of the coordinates of preliminary computed <result>.
Finds the isoline which is considered as degenerated with <preci> and a. distance between P3d and corresponding singular point is less than <preci> (like IsDegenerated) or b. difference between already computed <result>'s coordinate and isocoordinate of the boundary is less than 2D resolution (computed from <preci> by Geom_Adaptor). Then sets not yet computed <result>'s coordinate taking it from <neighbour> and returns True.
Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated  (  const Standard_Integer  nbrPnt, 
const TColgp_SequenceOfPnt &  points,  
TColgp_SequenceOfPnt2d &  pnt2d,  
const Standard_Real  preci,  
const Standard_Boolean  direct  
) 
Checks points at the beginning (direct is True) or end (direct is False) of array <points> to lie in singularity of surface, and if yes, adjusts the indeterminate 2d coordinate of these points by nearest point which is not in singularity. Returns True if some points were adjusted.
void ShapeAnalysis_Surface::SetDomain  (  const Standard_Real  U1, 
const Standard_Real  U2,  
const Standard_Real  V1,  
const Standard_Real  V2  
) 
Standard_Boolean ShapeAnalysis_Surface::Singularity  (  const Standard_Integer  num, 
Standard_Real &  preci,  
gp_Pnt &  P3d,  
gp_Pnt2d &  firstP2d,  
gp_Pnt2d &  lastP2d,  
Standard_Real &  firstpar,  
Standard_Real &  lastpar,  
Standard_Boolean &  uisodeg  
) 
Returns the characteristics of the singularity specified by its rank number <num>. That means, that it is not neccessary for <num> to be in the range [1, NbSingularities] but must be not greater than possible (see ComputeSingularities). The returned characteristics are: preci: the smallest precision with which the isoline is considered as degenerated, P3d: 3D point of singularity (middle point of the surface isoline), firstP2d and lastP2d: first and last 2D points of the isoline in parametrical surface, firstpar and lastpar: first and last parameters of the isoline in parametrical surface, uisodeg: if the degenerated isoline is Uiso (True) or Viso (False). Returns False if <num> is out of range, else returns True.
const Handle< Geom_Surface >& ShapeAnalysis_Surface::Surface  (  )  const 
Returns a surface being analyzed.
const Handle< GeomAdaptor_HSurface >& ShapeAnalysis_Surface::TrueAdaptor3d  (  )  const 
Returns the Adaptor (may be Null if method Adaptor() was not called)
Standard_Real ShapeAnalysis_Surface::UCloseVal  (  )  const 
Returns minimum value to consider the surface as Uclosed.
Handle< Geom_Curve > ShapeAnalysis_Surface::UIso  (  const Standard_Real  U  ) 
Returns a UIso. Null if not possible or failed Remark : bound isos are buffered.
Standard_Real ShapeAnalysis_Surface::UVFromIso  (  const gp_Pnt &  P3D, 
const Standard_Real  preci,  
Standard_Real &  U,  
Standard_Real &  V  
) 
Tries a refinement of an already computed couple (U,V) by using projecting 3D point on isolines:
gp_Pnt ShapeAnalysis_Surface::Value  (  const Standard_Real  u, 
const Standard_Real  v  
) 
Returns a 3D point specified by parameters in surface parametrical space.
Returns a 3d point specified by a point in surface parametrical space.
gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV  (  const gp_Pnt &  P3D, 
const Standard_Real  preci  
) 
Computes the parameters in the surface parametrical space of 3D point. The result is parameters of the point projected onto the surface. This method enhances functionality provided by the standard tool GeomAPI_ProjectPointOnSurface by treatment of cases when the projected point is near to the surface boundaries and when this standard tool fails.
Standard_Real ShapeAnalysis_Surface::VCloseVal  (  )  const 
Returns minimum value to consider the surface as Vclosed.
Handle< Geom_Curve > ShapeAnalysis_Surface::VIso  (  const Standard_Real  V  ) 
Returns a VIso. Null if not possible or failed Remark : bound isos are buffered.

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 

protected 