1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Compare commits

...

23 Commits

Author SHA1 Message Date
nbv
5c90c3a7ef Compilation errors 2018-12-11 09:19:04 +03:00
nbv
cdc74aad9f Documentation 2018-12-10 18:11:35 +03:00
nbv
306c3ea1fe Fix regressions 2018-12-10 18:11:34 +03:00
nbv
0273a8a01e Check of extension validity 2018-12-10 18:11:34 +03:00
nbv
3828af0c3b Pure virtual functions 2018-12-10 18:11:33 +03:00
nbv
e3e176358a HLRBRep_BSurfaceTool::IsUPeriodic
HLRBRep_Surface::IsUPeriodic
2018-12-10 18:11:32 +03:00
nbv
24a9d1a425 Adaptor3d_HSurfaceTool
BRepApprox_SurfaceTool
HLRBRep_SurfaceTool
2018-12-10 18:11:31 +03:00
nbv
1fcb1314a5 IntCurveSurface_TheHCurveTool
HLRBRep_LineTool
2018-12-10 18:11:31 +03:00
nbv
0551d229fe HLRBRep_Curve(Tool) 2018-12-10 18:11:30 +03:00
nbv
b5169952f0 BRepBlend_HCurveTool::IsPeriodic 2018-12-10 18:11:29 +03:00
nbv
a9d16e8a55 IntPatch_HCurve2dTool::IsPeriodic 2018-12-10 18:11:28 +03:00
nbv
b2fbc96924 Extrema_CurveTool::IsPeriodic 2018-12-10 18:11:28 +03:00
nbv
9765ceec03 Contap_HCurve2dTool::IsPeriodic 2018-12-10 18:11:27 +03:00
nbv
9c50685d87 BRepBlend_HCurve2dTool::IsPeriodic 2018-12-10 18:11:26 +03:00
nbv
e29426afd4 src/BOPTools/BOPTools_AlgoTools.cxx 2018-12-10 18:11:26 +03:00
nbv
7a1b6abbea src/ShapeBuild/ShapeBuild_Edge.cxx 2018-12-10 18:11:25 +03:00
nbv
88114cdb41 src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
Conflicts:
	src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
2018-12-10 18:11:24 +03:00
nbv
9d8bbc4755 Adaptor3d_Surface
D:\nbv-29115\occt\src\ProjLib\ProjLib_CompProjectedCurve.cxx (line 748, 930, 1799, 1832)
D:\nbv-29115\occt\src\ProjLib\ProjLib_ComputeApproxOnPolarSurface.cxx (line 113)
D:\nbv-29115\occt\src\IntSurf\IntSurf.cxx (line 104)
D:\nbv-29115\occt\src\BRepMesh\BRepMesh_EdgeTessellator.cxx (line 194)
D:\nbv-29115\occt\src\LocOpe\LocOpe_SplitShape.cxx (line 89)
D:\nbv-29115\occt\src\ChFi3d\ChFi3d_Builder_0.cxx (line 623)
2018-12-10 18:11:23 +03:00
nbv
13223d710e Adaptor3d 2018-12-10 18:11:22 +03:00
nbv
da113e0ffb Adaptor2d_Curve
d:\nbv-29115\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx, line 259
D:\nbv-29115\occt\src\BRepCheck\BRepCheck_Wire.cxx, line 989 && 1078
D:\nbv-29115\occt\src\HLRBRep\HLRBRep_PolyAlgo.cxx, line 884 && 1051
D:\nbv-29115\occt\src\ChFi3d\ChFi3d_Builder_SpKP.cxx, line 854
2018-12-10 18:11:21 +03:00
nbv
6a537593a1 Geom_RectangularTrimmedSurface 2018-12-10 18:11:20 +03:00
nbv
73fbbcd771 Geom_TrimmedCurve 2018-12-10 18:11:19 +03:00
nbv
9c55cd84c9 Geom2d_TrimmedCurve 2018-12-10 18:11:18 +03:00
333 changed files with 2597 additions and 2665 deletions

View File

@@ -723,6 +723,137 @@ When you write an algorithm which operates on geometric objects, use <i> Adaptor
As a result, you can use the algorithm with any kind of object, if you provide for this object an interface derived from *Adaptor3d* or *Adaptor2d*.
These interfaces are easy to use: simply create an adapted curve or surface from a *Geom2d* curve, and then use this adapted curve as an argument for the algorithm? which requires it.
@section occt_modat_4per Concept of periodicity applied in OCCT-algorithms
@subsection occt_modat_4per_1 Mathematical definition
In math, the following definition of periodicity is applied (detailed information can be found in <a href="https://en.wikipedia.org/wiki/Periodic_function">Wikipedia</a> or on the site of <a href="http://mathworld.wolfram.com/PeriodicFunction.html">WolframMathWorld</a>):
A function of a real variable \f$ f(x) \f$ is said to be periodic with period \f$ T \neq 0 \f$ if<br>
<span>1.</span> For every \f$ x \in \mathfrak{D}_{f} \f$ (\f$ \mathfrak{D}_{f} \f$ is the domain of the function \f$ f(x) \f$), the point \f$ \left (x \pm T*n \right ) \in \mathfrak{D}_{f} \f$ (where \f$ n \f$ applies positive integer values only: \f$ n=1,2,... \f$ ) and the condition
\f[ f(x-T*n)=f(x+T*n)=f(x) \f]
is satisfied.<br>
<span>2.</span> For every \f$ x \notin \mathfrak{D}_{f} \f$, the point \f$ \left (x \pm T*n \right ) \notin \mathfrak{D}_{f} \f$, (where \f$ n=1,2,... \f$ ).<br>
@subsubsection occt_modat_4per_1_1 Example
For example, the tangent function \f$ f(x)=\tan(x) \f$ is periodic with least period (a least positive constant \f$ T \f$, which will be called later as period) \f$ \pi \f$ because \f$ \tan(x) \f$ is not defined only in points \f$ x=\left (\frac{\pi }{2}\pm \pi *n \right ) \f$ (where \f$ n=0,1,2,... \f$) and for other points the condition<br>
\f[ \tan(x-\pi*n)=\tan(x+\pi*n)=\tan(x) \f]
is satisfied.
As we can see from the definition, any periodic function cannot have bounded domain (because product \f$ T*n \f$ tends to infinite) but can be discontinuous. Let us look, how it is realized in OCCT.
@subsection occt_modat_4per_2 Periodicity of bounded curves
First of all, OCCT works only with continuous elements (curves and surfaces). <b>I.e. work with curves having continuity less than C0 (e.g. with any gaps) is not supported.</b>
In OCCT, set of bounded curves includes only Bezier curves, B-spline curves and trimmed curves. Let us consider these objects from point of view to be periodic.
@subsubsection occt_modat_4per_2_1 Bezier curves
Bezier curve is always defined in the range \f$ \mathfrak{D}=\left [ 0,1 \right ] \f$ and does not allow any analytical extension. Therefore, <b>Bezier curve cannot be periodic at all</b>.
@subsubsection occt_modat_4per_2_2 B-spline curve
OCCT can create <a href="https://en.wikiversity.org/wiki/CAGD/B-splines#Periodic_B-splines">periodic B-spline</a> and can convert any closed B-spline into periodic one. At that, any periodic B-spline is defined on the set of real numbers (\f$ \mathfrak{D}=\mathbb{R} \f$). Nevertheless, in OCCT, periodic B-splines are included in set of bounded curves, too. The class of Bounded curves does not separate periodic and not-periodic B-splines.<br>
However, <b>range of not-periodic B-spline must be considered as its domain</b>. I.e. if any not-periodic B-spline curve is parametrized in the range \f$ t \in \left [ 0,1 \right ] \f$ then its evaluation in the point \f$ t=1.5 \f$ is forbidden (in general). Evaluation of B-spline curve on its analytical extension can be used in some cases. However, it is out of scope of this article.
@subsubsection occt_modat_4per_2_3 Trimmed curve
OCCT-algorithms allow trimmed curves existing out of trim boundaries (exceptionally, if these boundaries match the domain completely). Evidently, the trimmed curve is not defined in the region where its basis curve is not defined.<br>
E.g. if some trimmed curve is an arc of circle and the trim boundaries are \f$ t \in \left [ \frac{\pi }{2},\pi \right ] \f$ then nothing prevents us to compute the value of this arc in the point \f$ t=\frac{3\pi}{2} \f$. Analogically, for some line trimmed in the range \f$ t \in \left [ 0,1 \right ] \f$ nothing prevents us to compute the value in the point \f$ t=100 \f$. In other words, <b>trim boundaries must not be considered as domain boundaries</b>. And curve trimmed from any periodic curve exists out of trim boundaries. Consequently, this trimmed curve can be considered as periodic curve.<br>
Also, let us make the final conclusion. <b>In OCCT-algorithms, trimmed curve is considered to be periodic if its basis curve is periodic. At that trim boundaries do not play any role. I.e. the curve itself can be periodic and not-closed</b>.<br>
@subsubsection occt_modat_4per_2_4 Trim boundaries
@ref occt_modat_4per_2_3 "We have just found out" that the trim boundaries are not domain boundaries. But what is their real role in OCCT-algorithms?
Trim boundaries define some work range of the trimmed curve. Indeed, this (default) work range exists for any OCCT-curve (not only for trimmed one). For any periodic not-trimmed curve, the work range is \f$ \mathfrak{W}=\left [ 0,T \right ) \f$ (where \f$ T \f$ is the period of the curve). For bounded not-trimmed curve, this work range matches its domain. For other not-trimmed curves (e.g. line), the work range is \f$ \mathfrak{W}=\left ( -\infty ,+\infty \right ) \f$ (i.e. matches its domain, too).
Operation <b><i>"TRIM"</i></b> applied to the curve allows changing its default work range (shift or reduce but not increase). <b>Setting work range greater than the default one is strictly forbidden</b>.
E.g. the default work range of any circle is \f$ \mathfrak{W}=\left [ 0,2\pi \right ) \f$. With <b><i>"TRIM"</i></b> operation you can create trimmed circle (i.e. arc) with work ranges \f$ \left [ 0,\pi \right ] \f$, \f$ \left [ 5\pi,\frac{11\pi}{2} \right ] \f$, \f$ \left [ 100\pi,102\pi \right ] \f$ etc. However, you must have failed to create arc with work range \f$ \left [ 50\pi,55\pi \right ] \f$, because this new work range is greater than \f$ \mathfrak{W} \f$.
For not-periodic B-spline curve with default work range \f$ \mathfrak{W}=\left [ 0,1 \right ] \f$, you can create trimmed B-spline curve with work ranges \f$ \left [ 0,0.1 \right ] \f$, \f$ \left [ 0.6,0.78 \right ] \f$, \f$ \left [ 0.5,1 \right ] \f$ etc. However, you must have failed to set work range to \f$ \left [ 0.8,1.5 \right ] \f$ (because the input B-spline is not defined in the range \f$ \left ( 1,1.5 \right ] \f$).
For a line, you can create any work range with <b><i>"TRIM"</i></b> operation. Every work range will be valid.
Use the method **GeomLib::AllowExtend(...)** in order to check whether the new work range can be applied to the curve. Please see documentation about this method.
However, what does work range bring to OCCT? The point is that the most OCCT-algorithms tend to work in work ranges of their input data. So, if you call extrema high-level tool (exactly API) then you will obtain point with parameters already adjusted in work range of the arguments. If you call surface-surface intersection algorithm (API again) then you will obtain 3D-curve and two 2D-curves, which are already in surfaces work ranges (you do not need any shifting them). So, correct using work ranges makes work with OCCT more convenient.
@subsection occt_modat_4per_3 Periodicity of curves adaptors
In OCCT, periodicity of adaptors depends on the periodicity of its curves only. Any ranges are not taken into account.
At that, it is useful to note the fact that adaptors curve is always not trimmed. I.e. if some trimmed curve is sent into some adaptor then the adaptor will store the basis (not trimmed) curve and First/Last parameters of adaptor will be set to the corresponding trim-boundaries.
Moreover, there are some specific adaptors in OCCT. E.g. **BRepAdaptor_CompCurve**. Periodicity of such adaptors is defined in a special way. So, it is necessary to read reference manual about these classes in order to get more clear understanding of their behavior.
@subsection occt_modat_4per_4 Periodicity of surfaces
In OCCT, surface(s) is set in parametric form by vector-function of two real variables: \f$ S(U,V) \f$. As result, term of periodicity is considered for every such variable separately (\f$ U\f$-periodic and \f$ V \f$-periodic surfaces are considered). Also, there exist bi-periodic surfaces (e.g. Toroidal surface), which are periodic in both \f$ U \f$- and \f$ V \f$-directions (OCCT does not work with univariate function of a complex argument; therefore commonly-used terms "Double periodic" or "Triple periodic" are not figured in OCCT).
So, \f$ U \f$-periodic surface can be defined as follows: <b>The surface \f$ S(U,V) \f$ is \f$ U \f$-periodic if for every fixed value of \f$ V \f$-argument \f$ (V=V_{0})\f$ one of the following conditions is satisfied:<br>
<span>1.</span> For every \f$ U\in \mathbb{R} \f$, the point \f$ (U, V_{0}) \notin \mathfrak{D}_{S} \f$, where \f$ \mathfrak{D}_{S} \f$ is the domain of the surface \f$ S \f$;<br>
<span>2.</span> Otherwise, the univariate function of real variable \f$ F(U)=S(U,V_{0} ) \f$ is periodic.</b><br>
V-periodic surface can be defined analogically: <b>The surface \f$ S(U,V) \f$ is \f$ V \f$-periodic if for every fixed value of \f$ U \f$-argument \f$ (U=U_{0})\f$ one of the following conditions is satisfied:<br>
<span>1.</span> For every \f$ V\in \mathbb{R} \f$, the point \f$ (U_{0}, V) \notin \mathfrak{D}_{S} \f$, where \f$ \mathfrak{D}_{S} \f$ is the domain of the surface \f$ S \f$;<br>
<span>2.</span> Otherwise, the univariate function of real variable \f$ F(V)=S(U_{0}, V) \f$ is periodic.</b><br>
All remarks made @ref occt_modat_4per_2 "above" considering bounded curves are satisfied for bounded surfaces. At that, a work range of any surface is a region in 2D (rectangular) Cartesian coordinate system taking into account permissible values of U and V parameters. The example is given @ref occt_modat_4per_5 "below".
There exist some methods analogical to **GeomLib::AllowExtend(...)** but can be applied to surface. These methods are called **GeomLib::AllowExtendUParameter(...)** and **GeomLib::AllowExtendVParameter(...)**.
@subsection occt_modat_4per_5 Special questions about periodicity of surfaces
@subsubsection occt_modat_4per_5_1 Periodicity of a spherical surface
Let us consider a spherical surface having radius \f$ R \f$. It can be defined in local coordinate system (<a href="http://help.autodesk.com/view/INVNTOR/2014/ENU/?guid=GUID-FF15BB0D-5FE9-45F9-92FD-D70A3F6A8FD0">UCS</a>) by the vector function of two scalar arguments:
\f[
S\left ( U,V \right )=R* \begin{pmatrix}
\cos (U)*\cos (V)\\
\sin (U)*\cos (V)\\
\sin (V)
\end{pmatrix}
\f]
As we can see, this function is \f$ V \f$-periodic and its \f$ V \f$-period is equal to \f$ 2\pi \f$. And it is \f$ U \f$-periodic with \f$ U \f$-period \f$ 2\pi \f$. I.e. (theoretically) the default work range of any surface with such equation is the set of 2D-points such \f$ \mathfrak{W}=\left \{(U,V)|0\leq U < 2\pi, 0\leq V < 2\pi \right \} \f$.
However, let us take two different points in the parametric space: \f$ (0,0) \f$ and \f$ (\pi,\pi) \f$. Their 3D-images are: \f$ S\left ( 0,0 \right )=\begin{pmatrix}R & 0 & 0\end{pmatrix}^{T} \f$, \f$ S\left ( \pi,\pi \right )=\begin{pmatrix}R & 0 & 0\end{pmatrix}^{T} \f$. As we can see, 3D-points are the same. This fact is inappropriate for different points from one work range. Such result says about that the surface \f$ S(U,V) \f$ is self-interfered surface.
<b>Working with self-interfered elements is not supported by OCCT at all</b>. Therefore, in order to make spherical surface valid, specific domain is assigned to sphere. Namely:<br>
\f[ \mathfrak{D}_{S}= \left \{(U,V)|-\infty < U < +\infty , -\frac{\pi}{2}\leq V \leq \frac{\pi}{2} \right \} \f]
Of course, the range for V-parameter must be \f$ -\frac{\pi}{2}+2\pi n\leq V \leq \frac{\pi}{2}+2\pi n \f$ (where \f$ n \f$ applies positive integer values only: \f$ n=1,2,... \f$). However, this range is discontinuous and is not supported (see the section @ref occt_modat_4per_2). Therefore, \f$ V \f$-parameter of spherical surface is considered to be bounded. Consequently, <b>sphere is considered to be not \f$ V \f$-periodic</b>.
Based on this fact, the default spheres work range is \f$ \mathfrak{W}=\left \{(U,V)|0\leq U < 2\pi, -\frac{\pi}{2}\leq V \leq \frac{\pi}{2} \right \} \f$. Please pay attention to the fact that the spherical surface is \f$ U \f$-periodic surface. Therefore, value of \f$ U \f$-parameter can be any real number (the set \f$ \mathbb{R} \f$ ). However, its work range in \f$ U \f$-direction cannot be greater than \f$ 2\pi \f$. In that way the sphere is not self-interfered (the point \f$ (\pi,\pi) \f$ is out of its domain) and is valid completely.
@subsubsection occt_modat_4per_5_2 Periodicity of a Surface-of-Revolution
@ref occt_modat_4per_5_1 "Analogical situation" exists with surface of revolution. Having taken into account all said above, let us formulate conditions when the surface of revolution is \f$ V \f$-periodic.
Evidently, for that case, the basis curve must be periodic curve. Additionally, revolving full curve (taken with its default work range) must not lead to create self-interfered surface of revolution (i.e. this curve must not intersect the rotation axis). In other words, <b>the valid (not self-interfered) surface of revolution must be based on closed periodic curve in order to be \f$ V \f$-periodic</b>.
Please note that the basis curve can be not-closed by different reasons (not only in order to avoid creating self-interfered surface of revolution), which are neither nor separated nor analyzed by OCCT. OCCT uses simple check: periodicity of basis curve and its closure. It is connected with the fact that the property of periodicity of a Surface-of-Revolution is not very important for OCCT-algorithms because almost all algorithms work only with work range of a Surface-of-Revolution (i.e. in most cases we do not need in adjusting parameters).
Based on the foregoing, the domain of any not \f$ V \f$-periodic surface of revolution is \f$ \mathfrak{D}_{S}= \left \{(U,V)|-\infty < U < +\infty , C_{f} \leq V \leq C_{l} \right \} \f$, where \f$ \left [C_{f},C_{l} \right ] \f$ is the work range of the basis curve (i.e. the work range of the basis curve defines the domain of the surface). The default work range of this surface is \f$ \mathfrak{W}=\left \{(U,V)|0\leq U < 2\pi, C_{f} \leq V \leq C_{l} \right \} \f$.
Finally, it is got to be said that the constructors of surface of revolution do not check the situation when invalid result can be created. It must be done on application level (e.g. by using **GeomLib::AllowExtendVParameter(...)** method). We offer to use the following steps (which should be used only in places where you doubt in validity of created surface of revolution):
<span>1.</span>Create a surface of revolution with default work-range of the basis curve;<br>
<span>2.</span>Compute new work range of the basis curve (it depends on your requirements only);<br>
<span>3.</span>Call **GeomLib::AllowExtendVParameter(...)** method with existing surface of revolution and the new range. If the new range is valid the method will return TRUE.<br>
The method **GeomLib::AllowExtendVParameter(...)** works with spherical surface, too.
@subsection occt_modat_4per_6 Periodicity of surfaces adaptors
@ref occt_modat_4per_3 "As for curves", periodicity of adaptors depends on the periodicity of its surfaces only. All remarks about curve's adaptor are fair to surfaces.
@section occt_modat_5 Topology

View File

@@ -1222,7 +1222,7 @@ void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace,
BRepTopAdaptor_FClass2d aClassifier (theSecondFace, Precision::Confusion());
TopAbs_State aState =
aClassifier.Perform (gp_Pnt2d (aPU, aPV), theSecondSurf->IsUPeriodic() || theSecondSurf->IsVPeriodic());
aClassifier.Perform (gp_Pnt2d (aPU, aPV), theSecondSurf->IsUPeriodic111() || theSecondSurf->IsVPeriodic111());
if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN)
{

View File

@@ -129,7 +129,7 @@ Standard_Boolean Adaptor2d_Curve2d::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean Adaptor2d_Curve2d::IsPeriodic() const
Standard_Boolean Adaptor2d_Curve2d::IsPeriodic222() const
{
throw Standard_NotImplemented("Adaptor2d_Curve2d::IsPeriodic");
}

View File

@@ -84,11 +84,11 @@ public:
//! If <First> >= <Last>
Standard_EXPORT virtual Handle(Adaptor2d_HCurve2d) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
Standard_EXPORT virtual Standard_Boolean IsClosed() const;
Standard_EXPORT virtual Standard_Boolean IsClosed() const = 0;
Standard_EXPORT virtual Standard_Boolean IsPeriodic() const;
Standard_EXPORT virtual Standard_Boolean IsPeriodic222() const = 0;
Standard_EXPORT virtual Standard_Real Period() const;
Standard_EXPORT virtual Standard_Real Period() const = 0;
//! Computes the point of parameter U on the curve.
Standard_EXPORT virtual gp_Pnt2d Value (const Standard_Real U) const;

View File

@@ -76,7 +76,7 @@ public:
Standard_Boolean IsClosed() const;
Standard_Boolean IsPeriodic() const;
Standard_Boolean IsPeriodic222() const;
Standard_Real Period() const;

View File

@@ -92,9 +92,9 @@ inline Standard_Real Adaptor2d_HCurve2d::FirstParameter() const
//purpose :
//=======================================================================
inline Standard_Boolean Adaptor2d_HCurve2d::IsPeriodic() const
inline Standard_Boolean Adaptor2d_HCurve2d::IsPeriodic222() const
{
return Curve2d().IsPeriodic();
return Curve2d().IsPeriodic222();
}
//=======================================================================

View File

@@ -161,7 +161,7 @@ Standard_Boolean Adaptor2d_Line2d::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean Adaptor2d_Line2d::IsPeriodic() const
Standard_Boolean Adaptor2d_Line2d::IsPeriodic222() const
{
return Standard_False;
}

View File

@@ -87,7 +87,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -276,9 +276,9 @@ Standard_Boolean Adaptor2d_OffsetCurve::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean Adaptor2d_OffsetCurve::IsPeriodic() const
Standard_Boolean Adaptor2d_OffsetCurve::IsPeriodic222() const
{
return myCurve->IsPeriodic();
return myCurve->IsPeriodic222();
}
//=======================================================================

View File

@@ -105,7 +105,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -106,40 +106,6 @@ Handle(Adaptor3d_HCurve) Adaptor3d_Curve::Trim(const Standard_Real , const Stand
throw Standard_NotImplemented("Adaptor3d_Curve::Trim");
}
//=======================================================================
//function : IsClosed
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Curve::IsClosed() const
{
throw Standard_NotImplemented("Adaptor3d_Curve::IsClosed");
}
//=======================================================================
//function : IsPeriodic
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Curve::IsPeriodic() const
{
throw Standard_NotImplemented("Adaptor3d_Curve::IsPeriodic");
}
//=======================================================================
//function : Period
//purpose :
//=======================================================================
Standard_Real Adaptor3d_Curve::Period() const
{
throw Standard_NotImplemented("Adaptor3d_Curve::Period");
}
//=======================================================================
//function : Value
//purpose :

View File

@@ -86,11 +86,11 @@ public:
//! If <First> >= <Last>
Standard_EXPORT virtual Handle(Adaptor3d_HCurve) Trim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
Standard_EXPORT virtual Standard_Boolean IsClosed() const;
Standard_EXPORT virtual Standard_Boolean IsClosed() const = 0;
Standard_EXPORT virtual Standard_Boolean IsPeriodic() const;
Standard_EXPORT virtual Standard_Boolean IsPeriodic222() const = 0;
Standard_EXPORT virtual Standard_Real Period() const;
Standard_EXPORT virtual Standard_Real Period() const = 0;
//! Computes the point of parameter U on the curve.
Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U) const;

View File

@@ -952,9 +952,9 @@ Standard_Boolean Adaptor3d_CurveOnSurface::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_CurveOnSurface::IsPeriodic() const
Standard_Boolean Adaptor3d_CurveOnSurface::IsPeriodic222() const
{
return myCurve->IsPeriodic();
return myCurve->IsPeriodic222();
}
//=======================================================================
@@ -1375,12 +1375,12 @@ Handle(Geom_BSplineCurve) Adaptor3d_CurveOnSurface::BSpline() const
Bsp2d->Weights(Weights);
Bsp = new Geom_BSplineCurve(Poles,Weights,Knots,Mults,
Bsp2d->Degree(),
Bsp2d->IsPeriodic());
Bsp2d->IsPeriodic111());
}
else {
Bsp = new Geom_BSplineCurve(Poles,Knots,Mults,
Bsp2d->Degree(),
Bsp2d->IsPeriodic());
Bsp2d->IsPeriodic111());
}
return Bsp;
}

View File

@@ -112,7 +112,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -93,7 +93,7 @@ public:
Standard_Boolean IsClosed() const;
Standard_Boolean IsPeriodic() const;
Standard_Boolean IsPeriodic222() const;
Standard_Real Period() const;

View File

@@ -92,9 +92,9 @@ inline Standard_Real Adaptor3d_HCurve::FirstParameter() const
//purpose :
//=======================================================================
inline Standard_Boolean Adaptor3d_HCurve::IsPeriodic() const
inline Standard_Boolean Adaptor3d_HCurve::IsPeriodic222() const
{
return Curve().IsPeriodic();
return Curve().IsPeriodic222();
}
//=======================================================================

View File

@@ -95,11 +95,11 @@ public:
Standard_Boolean IsVClosed() const;
Standard_Boolean IsUPeriodic() const;
Standard_Boolean IsUPeriodic222() const;
Standard_Real UPeriod() const;
Standard_Boolean IsVPeriodic() const;
Standard_Boolean IsVPeriodic222() const;
Standard_Real VPeriod() const;

View File

@@ -168,9 +168,9 @@ inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::VTrim
//purpose :
//=======================================================================
inline Standard_Boolean Adaptor3d_HSurface::IsUPeriodic() const
inline Standard_Boolean Adaptor3d_HSurface::IsUPeriodic222() const
{
return Surface().IsUPeriodic();
return Surface().IsUPeriodic222();
}
//=======================================================================
@@ -188,9 +188,9 @@ inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::VTrim
//purpose :
//=======================================================================
inline Standard_Boolean Adaptor3d_HSurface::IsVPeriodic() const
inline Standard_Boolean Adaptor3d_HSurface::IsVPeriodic222() const
{
return Surface().IsVPeriodic();
return Surface().IsVPeriodic222();
}
//=======================================================================

View File

@@ -80,11 +80,11 @@ public:
static Standard_Boolean IsVClosed (const Handle(Adaptor3d_HSurface)& S);
static Standard_Boolean IsUPeriodic (const Handle(Adaptor3d_HSurface)& S);
static Standard_Boolean IsUPeriodic333 (const Handle(Adaptor3d_HSurface)& S);
static Standard_Real UPeriod (const Handle(Adaptor3d_HSurface)& S);
static Standard_Boolean IsVPeriodic (const Handle(Adaptor3d_HSurface)& S);
static Standard_Boolean IsVPeriodic333 (const Handle(Adaptor3d_HSurface)& S);
static Standard_Real VPeriod (const Handle(Adaptor3d_HSurface)& S);

View File

@@ -98,9 +98,9 @@ inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVClosed(const Handle(Adaptor3d
return S->IsVClosed();
}
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsUPeriodic(const Handle(Adaptor3d_HSurface)& S)
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsUPeriodic333(const Handle(Adaptor3d_HSurface)& S)
{
return S->IsUPeriodic();
return S->IsUPeriodic222();
}
inline Standard_Real Adaptor3d_HSurfaceTool::UPeriod(const Handle(Adaptor3d_HSurface)& S)
@@ -108,9 +108,9 @@ inline Standard_Real Adaptor3d_HSurfaceTool::UPeriod(const Handle(Adaptor3d_HSur
return S->UPeriod();
}
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVPeriodic(const Handle(Adaptor3d_HSurface)& S)
inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVPeriodic333(const Handle(Adaptor3d_HSurface)& S)
{
return S->IsVPeriodic();
return S->IsVPeriodic222();
}
inline Standard_Real Adaptor3d_HSurfaceTool::VPeriod(const Handle(Adaptor3d_HSurface)& S)

View File

@@ -171,7 +171,7 @@ void Adaptor3d_IsoCurve::Load(const GeomAbs_IsoType Iso,
Standard_Real dummy = myParameter;
if (mySurface->IsUPeriodic()) {
if (mySurface->IsUPeriodic222()) {
if (myIso == GeomAbs_IsoU) {
ElCLib::AdjustPeriodic
@@ -191,7 +191,7 @@ void Adaptor3d_IsoCurve::Load(const GeomAbs_IsoType Iso,
}
}
if (mySurface->IsVPeriodic()) {
if (mySurface->IsVPeriodic222()) {
if (myIso == GeomAbs_IsoV) {
ElCLib::AdjustPeriodic
@@ -345,13 +345,13 @@ Standard_Boolean Adaptor3d_IsoCurve::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_IsoCurve::IsPeriodic() const
Standard_Boolean Adaptor3d_IsoCurve::IsPeriodic222() const
{
switch (myIso) {
case GeomAbs_IsoU:
return mySurface->IsVPeriodic();
return mySurface->IsVPeriodic222();
case GeomAbs_IsoV:
return mySurface->IsUPeriodic();
return mySurface->IsUPeriodic222();
case GeomAbs_NoneIso:
default:
break;

View File

@@ -114,7 +114,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -179,73 +179,6 @@ Handle(Adaptor3d_HSurface) Adaptor3d_Surface::VTrim(const Standard_Real , const
throw Standard_NotImplemented("Adaptor3d_Surface::VTrim");
}
//=======================================================================
//function : IsUClosed
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Surface::IsUClosed() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::IsUClosed");
}
//=======================================================================
//function : IsVClosed
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Surface::IsVClosed() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::IsVClosed");
}
//=======================================================================
//function : IsUPeriodic
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Surface::IsUPeriodic() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::IsUPeriodic");
}
//=======================================================================
//function : UPeriod
//purpose :
//=======================================================================
Standard_Real Adaptor3d_Surface::UPeriod() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::UPeriod");
}
//=======================================================================
//function : IsVPeriodic
//purpose :
//=======================================================================
Standard_Boolean Adaptor3d_Surface::IsVPeriodic() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::IsVPeriodic");
}
//=======================================================================
//function : VPeriod
//purpose :
//=======================================================================
Standard_Real Adaptor3d_Surface::VPeriod() const
{
throw Standard_NotImplemented("Adaptor3d_Surface::VPeriod");
}
//=======================================================================
//function : Value
//purpose :

View File

@@ -51,7 +51,7 @@ class Adaptor3d_HCurve;
//! the surface by algorithms which use it.
//! A derived concrete class is provided:
//! GeomAdaptor_Surface for a surface from the Geom package.
//! The Surface class describes the standard behaviour
//! The Surface class describes the standard behavior
//! of a surface for generic algorithms.
//!
//! The Surface can be decomposed in intervals of any
@@ -59,7 +59,7 @@ class Adaptor3d_HCurve;
//! NbIntervals. A current interval can be set. Most
//! of the methods apply to the current interval.
//! Warning: All the methods are virtual and implemented with a
//! raise to allow to redefined only the methods realy
//! raise to allow to redefined only the methods really
//! used.
//!
//! Polynomial coefficients of BSpline surfaces used for their evaluation are
@@ -113,17 +113,17 @@ public:
//! If <First> >= <Last>
Standard_EXPORT virtual Handle(Adaptor3d_HSurface) VTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const;
Standard_EXPORT virtual Standard_Boolean IsUClosed() const;
Standard_EXPORT virtual Standard_Boolean IsUClosed() const = 0;
Standard_EXPORT virtual Standard_Boolean IsVClosed() const;
Standard_EXPORT virtual Standard_Boolean IsVClosed() const = 0;
Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const;
Standard_EXPORT virtual Standard_Boolean IsUPeriodic222() const = 0;
Standard_EXPORT virtual Standard_Real UPeriod() const;
Standard_EXPORT virtual Standard_Real UPeriod() const = 0;
Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const;
Standard_EXPORT virtual Standard_Boolean IsVPeriodic222() const = 0;
Standard_EXPORT virtual Standard_Real VPeriod() const;
Standard_EXPORT virtual Standard_Real VPeriod() const = 0;
//! Computes the point of parameters U,V on the surface.
Standard_EXPORT virtual gp_Pnt Value (const Standard_Real U, const Standard_Real V) const;

View File

@@ -829,7 +829,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
if(MyImplicitFirst) {
if(u2<binfu-0.0000000001) {
if(ThePSurfaceTool::IsUPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsUPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::UPeriod(aPSurf);
do { TranslationU+=d; } while(u2+TranslationU < binfu);
}
@@ -837,7 +837,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
else if(u2>bsupu+0.0000000001) {
if(ThePSurfaceTool::IsUPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsUPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::UPeriod(aPSurf);
do { TranslationU-=d; } while(u2+TranslationU > bsupu);
}
@@ -845,7 +845,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
if(v2<binfv-0.0000000001) {
if(ThePSurfaceTool::IsVPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsVPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::VPeriod(aPSurf);
do { TranslationV+=d; } while(v2+TranslationV < binfv);
}
@@ -853,7 +853,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
else if(v2>bsupv+0.0000000001) {
if(ThePSurfaceTool::IsVPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsVPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::VPeriod(aPSurf);
do { TranslationV-=d; } while(v2+TranslationV > bsupv);
}
@@ -865,7 +865,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
}
else {
if(u1<binfu-0.0000000001) {
if(ThePSurfaceTool::IsUPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsUPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::UPeriod(aPSurf);
do { TranslationU+=d; } while(u1+TranslationU < binfu);
}
@@ -873,7 +873,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
else if(u1>bsupu+0.0000000001) {
if(ThePSurfaceTool::IsUPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsUPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::UPeriod(aPSurf);
do { TranslationU-=d; } while(u1+TranslationU > bsupu);
}
@@ -881,7 +881,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
if(v1<binfv-0.0000000001) {
if(ThePSurfaceTool::IsVPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsVPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::VPeriod(aPSurf);
do { TranslationV+=d; } while(v1+TranslationV < binfv);
}
@@ -889,7 +889,7 @@ ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution(const Standard_Real u1,
return(Standard_False);
}
else if(v1>bsupv+0.0000000001) {
if(ThePSurfaceTool::IsVPeriodic(aPSurf)) {
if(ThePSurfaceTool::IsVPeriodic333(aPSurf)) {
Standard_Real d = ThePSurfaceTool::VPeriod(aPSurf);
do { TranslationV-=d; } while(v1+TranslationV > bsupv);
}

View File

@@ -285,7 +285,7 @@ class BOPAlgo_MPC : public BOPAlgo_Algo {
else
{
const BRepAdaptor_Surface& aBAS = myContext->SurfaceAdaptor(myF);
if (aBAS.IsUPeriodic() || aBAS.IsVPeriodic())
if (aBAS.IsUPeriodic222() || aBAS.IsVPeriodic222())
{
// The curve already exists. Adjust it for periodic cases.
BOPTools_AlgoTools2D::AdjustPCurveOnSurf

View File

@@ -1580,9 +1580,7 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
//
aTolE=BRep_Tool::Tolerance(aE);
//
const Handle(Geom_Curve)& aC3DE=BRep_Tool::Curve(aE, aT1, aT2);
Handle(Geom_TrimmedCurve)aC3DETrim=
new Geom_TrimmedCurve(aC3DE, aT1, aT2);
BRep_Tool::Range(aE, aT1, aT2);
//
for (i=0; i<2; ++i) {
bPC = !i ? bPC1 : bPC2;
@@ -1602,21 +1600,15 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE,
aFFWD.Orientation(TopAbs_FORWARD);
//
aC2D=aC2Dx1;
if (aC2D.IsNull()) {
if (aC2D.IsNull())
{
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aFFWD, theContext);
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFFWD, aC2D,
aOutFirst, aOutLast,
aOutTol, theContext);
}
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFFWD, aC2D,
aOutFirst, aOutLast,
aOutTol, theContext);
}
//
if (aC3DE->IsPeriodic()) {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D,
aC2DA, theContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D,
aC2DA, theContext);
}
BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA, theContext);
//
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
//BRepLib::SameParameter(aE);

View File

@@ -250,22 +250,6 @@ Standard_Boolean BOPTools_AlgoTools2D::HasCurveOnSurface
//function : AdjustPCurveOnFace
//purpose :
//=======================================================================
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
(const TopoDS_Face& theF,
const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext)
{
Standard_Real aT1 = theC3D->FirstParameter();
Standard_Real aT2 = theC3D->LastParameter();
//
BOPTools_AlgoTools2D::AdjustPCurveOnFace (theF, aT1, aT2, theC2D, theC2DA, theContext);
}
//=======================================================================
//function : AdjustPCurveOnFace
//purpose :
//=======================================================================
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
(const TopoDS_Face& theF,
const Standard_Real theFirst,
@@ -319,7 +303,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
//
// du
du = 0.;
if (aBAS.IsUPeriodic()) {
if (aBAS.IsUPeriodic222()) {
aUPeriod = aBAS.UPeriod();
//
@@ -356,7 +340,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
// dv
dv = 0.;
if (aBAS.IsVPeriodic()) {
if (aBAS.IsVPeriodic222()) {
Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr;
//
aVPeriod = aBAS.VPeriod();
@@ -384,7 +368,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
Standard_Real u,v;
u = u2 + du;
v = v2 + dv;
if (aBAS.IsUPeriodic()) {
if (aBAS.IsUPeriodic222()) {
aUPeriod = aBAS.UPeriod();
if ((UMax - UMin - 2*aDelta) > aUPeriod) {
if ((u > (UMin + aDelta + aUPeriod)) ||
@@ -400,7 +384,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf
}
//
u = u2 + du;
if (aBAS.IsVPeriodic()) {
if (aBAS.IsVPeriodic222()) {
Standard_Real aVPeriod = aBAS.VPeriod();
if ((VMax - VMin - 2*aDelta) > aVPeriod) {
if ((v > (VMin + aDelta + aVPeriod)) ||

View File

@@ -45,38 +45,38 @@ public:
//! Compute P-Curve for the edge <aE> on the face <aF>.<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
Standard_EXPORT static Standard_Boolean EdgeTangent(const TopoDS_Edge& anE,
const Standard_Real aT,
gp_Vec& Tau);
//! Compute surface parameters <U,V> of the face <aF>
//! for the point from the edge <aE> at parameter <aT>.<br>
//! If <aE> has't pcurve on surface, algorithm tries to get it by
//! projection and can
//! raise exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void PointOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Standard_Real aT,
Standard_Real& U,
Standard_Real& V,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Standard_Real aT,
Standard_Real& U,
Standard_Real& V,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
//! [aToler] - reached tolerance
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! If the P-Curve does not exist, build it using Make2D().<br>
@@ -84,14 +84,14 @@ public:
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! [aFirst, aLast] - range of the P-Curve
@@ -103,30 +103,22 @@ public:
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler);
//! Returns TRUE if the edge <aE> has P-Curve <aC>
//! on surface <aF> .
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
Standard_EXPORT static Standard_Boolean HasCurveOnSurface(const TopoDS_Edge& aE,
const TopoDS_Face& aF);
//! Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
const Handle(Geom_Curve)& theC3D,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .<br>
//! [aT1, aT2] - range to adjust<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& theC2D,
Handle(Geom2d_Curve)& theC2DA,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
//! [aT1, aT2] - range to adjust
@@ -135,50 +127,50 @@ public:
const Standard_Real aT2,
const Handle(Geom2d_Curve)& aC2D,
Handle(Geom2d_Curve)& aC2DA);
//! Compute intermediate value in between [aFirst, aLast] .
Standard_EXPORT static Standard_Real IntermediatePoint(const Standard_Real aFirst,
const Standard_Real aLast);
//! Compute intermediate value of parameter for the edge <anE>.
Standard_EXPORT static Standard_Real IntermediatePoint(const TopoDS_Edge& anE);
Standard_EXPORT static Standard_Real IntermediatePoint (const TopoDS_Edge& anE);
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .<br>
//! [aFirst, aLast] - range of the P-Curve<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void Make2D(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE,
const TopoDS_Face& aF,
Handle(Geom2d_Curve)& aC,
Standard_Real& aFirst,
Standard_Real& aLast,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
//! [aT1, aT2] - range to build<br>
//! [aToler] - reached tolerance<br>
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
//! <theContext> - storage for caching the geometrical tools
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
const Standard_Real aT1,
const Standard_Real aT2,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
const Handle(Geom_Curve)& C3D,
const Standard_Real aT1,
const Standard_Real aT2,
Handle(Geom2d_Curve)& aC,
Standard_Real& aToler,
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
//! Attach P-Curve from the edge <aEold> on surface <aF>
//! to the edge <aEnew>
//! Returns 0 in case of success

View File

@@ -75,8 +75,8 @@ static
void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
const TopoDS_Face& aF)
{
Standard_Boolean bIsUPeriodic, bIsVPeriodic, bIsLeft;
Standard_Real aTol, a, b, anUPeriod, anVPeriod, aT, anU, dU, anU1;
Standard_Boolean bIsLeft;
Standard_Real aTol, a, b, aT, anU, dU, anU1;
Standard_Real aScPr, anV, dV, anV1;
Standard_Real aUmin, aUmax, aVmin, aVmax;
gp_Pnt2d aP2D;
@@ -97,58 +97,19 @@ void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
//
aS->Bounds(aUmin, aUmax, aVmin, aVmax);
//
bIsUPeriodic=aS->IsUPeriodic();
bIsVPeriodic=aS->IsVPeriodic();
const Standard_Boolean bIsUPeriodic = aS->IsUPeriodic111(),
bIsVPeriodic = aS->IsVPeriodic111();
const Standard_Real anUPeriod = bIsUPeriodic ? aS->UPeriod() : 0.,
anVPeriod = bIsVPeriodic ? aS->VPeriod() : 0.;
const Standard_Boolean bIsUClosed = aS->IsUClosed(),
bIsVClosed = aS->IsVClosed();
//
anUPeriod = bIsUPeriodic ? aS->UPeriod() : 0.;
anVPeriod = bIsVPeriodic ? aS->VPeriod() : 0.;
//
if (!bIsUPeriodic && !bIsVPeriodic) {
Standard_Boolean bIsUClosed, bIsVClosed;
Handle(Geom_BSplineSurface) aBS;
Handle(Geom_BezierSurface) aBZ;
Handle(Geom_RectangularTrimmedSurface) aRTS;
//
bIsUClosed=Standard_False;
bIsVClosed=Standard_False;
aBS=Handle(Geom_BSplineSurface)::DownCast(aS);
aBZ=Handle(Geom_BezierSurface) ::DownCast(aS);
aRTS=Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
//
if (!aBS.IsNull()) {
bIsUClosed=aBS->IsUClosed();
bIsVClosed=aBS->IsVClosed();
}
else if (!aBZ.IsNull()) {
bIsUClosed=aBZ->IsUClosed();
bIsVClosed=aBZ->IsVClosed();
}
else if (!aRTS.IsNull()) {
Handle(Geom_Surface) aSB;
//
aSB=aRTS->BasisSurface();
bIsUPeriodic=aSB->IsUPeriodic();
bIsVPeriodic=aSB->IsVPeriodic();
//
if (!(bIsUPeriodic || bIsVPeriodic)) {
return;
}
anUPeriod = bIsUPeriodic ? aSB->UPeriod() : 0.;
anVPeriod = bIsVPeriodic ? aSB->VPeriod() : 0.;
}
//
if (aRTS.IsNull()) {
if (!bIsUClosed && !bIsVClosed) {
return;
}
//
if (bIsUClosed) {
anUPeriod=aUmax-aUmin;
}
if (bIsVClosed) {
anVPeriod=aVmax-aVmin;
}
}
if ((!bIsUPeriodic || !bIsUClosed) &&
(!bIsVPeriodic || !bIsVClosed))
{
return;
}
//
//---------------------------------------------------

View File

@@ -284,7 +284,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
return myWire.Closed();
}
Standard_Boolean BRepAdaptor_CompCurve::IsPeriodic() const
Standard_Boolean BRepAdaptor_CompCurve::IsPeriodic222() const
{
return Standard_False;

View File

@@ -113,7 +113,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -344,13 +344,13 @@ Standard_Boolean BRepAdaptor_Curve::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean BRepAdaptor_Curve::IsPeriodic() const
Standard_Boolean BRepAdaptor_Curve::IsPeriodic222() const
{
if (myConSurf.IsNull()) {
return myCurve.IsPeriodic();
return myCurve.IsPeriodic222();
}
else {
return myConSurf->IsPeriodic();
return myConSurf->IsPeriodic222();
}
}

View File

@@ -149,7 +149,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -145,11 +145,11 @@ public:
Standard_Boolean IsVClosed() const Standard_OVERRIDE;
Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
Standard_Boolean IsUPeriodic222() const Standard_OVERRIDE;
Standard_Real UPeriod() const Standard_OVERRIDE;
Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
Standard_Boolean IsVPeriodic222() const Standard_OVERRIDE;
Standard_Real VPeriod() const Standard_OVERRIDE;

View File

@@ -121,9 +121,9 @@ inline Standard_Boolean BRepAdaptor_Surface::IsVClosed()const
//purpose :
//=======================================================================
inline Standard_Boolean BRepAdaptor_Surface::IsUPeriodic()const
inline Standard_Boolean BRepAdaptor_Surface::IsUPeriodic222()const
{
return mySurf.IsUPeriodic();
return mySurf.IsUPeriodic222();
}
//=======================================================================
@@ -141,9 +141,9 @@ inline Standard_Real BRepAdaptor_Surface::UPeriod()const
//purpose :
//=======================================================================
inline Standard_Boolean BRepAdaptor_Surface::IsVPeriodic()const
inline Standard_Boolean BRepAdaptor_Surface::IsVPeriodic222()const
{
return mySurf.IsVPeriodic();
return mySurf.IsVPeriodic222();
}
//=======================================================================

View File

@@ -229,13 +229,13 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire)
GeomAdaptor_Curve aGACurve(aCurve);
GeomAbs_CurveType aType = aGACurve.GetType();
Handle(Geom_Curve) aBasisCurve = aGACurve.Curve();
Standard_Boolean isFwd = (wexp.Orientation() != TopAbs_REVERSED);
if (aBasisCurve->IsPeriodic()) {
ElCLib::AdjustPeriodic
(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(),
Precision::PConfusion(), fpar, lpar);
if (aGACurve.IsPeriodic222())
{
const Handle(Geom_Curve) &aBasisCurve = aGACurve.Curve();
ElCLib::AdjustPeriodic(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(),
Precision::PConfusion(), fpar, lpar);
}
if (CurveSeq.IsEmpty()) {
@@ -353,9 +353,10 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire)
if (isSameCurve) {
const Standard_Boolean isSameDir = (isFwd == IsFwdSeq.Last());
if (aBasisCurve->IsPeriodic()) {
if (aGACurve.IsPeriodic222())
{
// Treat periodic curves.
const Standard_Real aPeriod = aBasisCurve->Period();
const Standard_Real aPeriod = aGACurve.Period();
if (isSameDir) {
// Check if first parameter is greater then the last one.

View File

@@ -81,11 +81,11 @@ public:
static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsUPeriodic333 (const BRepAdaptor_Surface& S);
static Standard_Real UPeriod (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S);
static Standard_Boolean IsVPeriodic333 (const BRepAdaptor_Surface& S);
static Standard_Real VPeriod (const BRepAdaptor_Surface& S);

View File

@@ -83,9 +83,9 @@ inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surf
return S.IsVClosed();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic333(const BRepAdaptor_Surface& S)
{
return S.IsUPeriodic();
return S.IsUPeriodic222();
}
inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S)
@@ -93,9 +93,9 @@ inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface&
return S.UPeriod();
}
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S)
inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic333(const BRepAdaptor_Surface& S)
{
return S.IsVPeriodic();
return S.IsVPeriodic222();
}
inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S)

View File

@@ -71,8 +71,6 @@ public:
static Standard_Boolean IsClosed (const Handle(Adaptor2d_HCurve2d)& C);
static Standard_Boolean IsPeriodic (const Handle(Adaptor2d_HCurve2d)& C);
static Standard_Real Period (const Handle(Adaptor2d_HCurve2d)& C);
//! Computes the point of parameter U on the curve.

View File

@@ -57,10 +57,6 @@ inline Standard_Boolean BRepBlend_HCurve2dTool::IsClosed(const Handle(Adaptor2d_
return(C->IsClosed());
}
//============================================================
inline Standard_Boolean BRepBlend_HCurve2dTool::IsPeriodic(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->IsPeriodic());
}
//============================================================
inline Standard_Real BRepBlend_HCurve2dTool::Period(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Period());
}

View File

@@ -71,7 +71,7 @@ public:
static Standard_Boolean IsClosed (const Handle(Adaptor3d_HCurve)& C);
static Standard_Boolean IsPeriodic (const Handle(Adaptor3d_HCurve)& C);
static Standard_Boolean IsPeriodic666 (const Handle(Adaptor3d_HCurve)& C);
static Standard_Real Period (const Handle(Adaptor3d_HCurve)& C);

View File

@@ -57,8 +57,8 @@ inline Standard_Boolean BRepBlend_HCurveTool::IsClosed(const Handle(Adaptor3d_HC
return(C->IsClosed());
}
//============================================================
inline Standard_Boolean BRepBlend_HCurveTool::IsPeriodic(const Handle(Adaptor3d_HCurve)& C) {
return(C->IsPeriodic());
inline Standard_Boolean BRepBlend_HCurveTool::IsPeriodic666(const Handle(Adaptor3d_HCurve)& C) {
return(C->IsPeriodic222());
}
//============================================================
inline Standard_Real BRepBlend_HCurveTool::Period(const Handle(Adaptor3d_HCurve)& C) {

View File

@@ -39,6 +39,7 @@
#include <BRepTools.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_BezierSurface.hxx>
#include <GeomLib.hxx>
#include <Bnd_Box2d.hxx>
#include <BndLib_Add2dCurve.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
@@ -47,6 +48,8 @@
#include <Geom_Plane.hxx>
#include <Extrema_ExtSS.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomAdaptor_HSurface.hxx>
//
static Standard_Boolean CanUseEdges(const Adaptor3d_Surface& BS);
//
@@ -470,7 +473,6 @@ void FindExactUVBounds(const TopoDS_Face FF,
umax = aBAS.LastUParameter();
vmin = aBAS.FirstVParameter();
vmax = aBAS.LastVParameter();
Standard_Boolean isUperiodic = aBAS.IsUPeriodic(), isVperiodic = aBAS.IsVPeriodic();
Standard_Real aT1, aT2;
Standard_Real TolU = Max(aBAS.UResolution(Tol), Precision::PConfusion());
Standard_Real TolV = Max(aBAS.VResolution(Tol), Precision::PConfusion());
@@ -502,13 +504,13 @@ void FindExactUVBounds(const TopoDS_Face FF,
aV /= Sqrt(magn);
}
Standard_Real u = aP.X(), v = aP.Y();
if(isUperiodic)
if (aBAS.IsUPeriodic222())
{
ElCLib::InPeriod(u, umin, umax);
ElCLib::InPeriod(u, umin, umin + aBAS.UPeriod());
}
if(isVperiodic)
if (aBAS.IsVPeriodic222())
{
ElCLib::InPeriod(v, vmin, vmax);
ElCLib::InPeriod(v, vmin, vmin + aBAS.VPeriod());
}
//
if(Abs(u - umin) <= TolU || Abs(u - umax) <= TolU)
@@ -588,33 +590,33 @@ void FindExactUVBounds(const TopoDS_Face FF,
Handle(Geom_Surface) aS = BRep_Tool::Surface(FF, aLoc);
Standard_Real aUmin, aUmax, aVmin, aVmax;
aS->Bounds(aUmin, aUmax, aVmin, aVmax);
if(!aS->IsUPeriodic())
if (!GeomLib::AllowExtendUParameter(aBAS.Surface(), umin, umax))
{
umin = Max(aUmin, umin);
umax = Min(aUmax, umax);
}
else
{
if(umax - umin > aS->UPeriod())
const Standard_Real aDelta = (umax - umin - aBAS.UPeriod()) / 2.0;
if (aBAS.IsUPeriodic222() && (aDelta > 0.0))
{
Standard_Real delta = umax - umin - aS->UPeriod();
umin += delta/2.;
umax -= delta/2;
umin += aDelta;
umax -= aDelta;
}
}
//
if(!aS->IsVPeriodic())
if (!GeomLib::AllowExtendVParameter(aBAS.Surface(), vmin, vmax))
{
vmin = Max(aVmin, vmin);
vmax = Min(aVmax, vmax);
}
else
{
if(vmax - vmin > aS->VPeriod())
const Standard_Real aDelta = (vmax - vmin - aS->VPeriod()) / 2.0;
if (aBAS.IsVPeriodic222() && (aDelta > 0.0))
{
Standard_Real delta = vmax - vmin - aS->VPeriod();
vmin += delta/2.;
vmax -= delta/2;
vmin += aDelta;
vmax -= aDelta;
}
}
}

View File

@@ -217,9 +217,9 @@ static Standard_Boolean IsClosedByIsos(const Handle(Geom_Surface)& thesurf,
{
Standard_Boolean isClosed = Standard_False;
gp_Pnt2d psurf1 = (acrv2d->IsPeriodic() ?
gp_Pnt2d psurf1 = (acrv2d->IsPeriodic111() ?
acrv2d->Value(f2d) : acrv2d->Value(Max(f2d,acrv2d->FirstParameter())));
gp_Pnt2d psurf2 = (acrv2d->IsPeriodic() ?
gp_Pnt2d psurf2 = (acrv2d->IsPeriodic111() ?
acrv2d->Value(l2d) : acrv2d->Value(Min(l2d,acrv2d->LastParameter())));
Handle(Geom_Curve) aCrv1;
Handle(Geom_Curve) aCrv2;

View File

@@ -184,7 +184,7 @@ void BRepCheck_Edge::Minimum()
Handle(Geom_Curve) C3d = Handle(Geom_Curve)::DownCast
(myCref->Curve3D()->Transformed
(/*myCref->Location()*/L.Transformation()));
Standard_Boolean IsPeriodic = C3d->IsPeriodic();
Standard_Boolean IsPeriodic = C3d->IsPeriodic111();
Standard_Real aPeriod = RealLast();
if(IsPeriodic)
{
@@ -193,10 +193,12 @@ void BRepCheck_Edge::Minimum()
Standard_Real f = C3d->FirstParameter(), l = C3d->LastParameter();
if (C3d->DynamicType() == STANDARD_TYPE(Geom_TrimmedCurve))
{
// E.g. see "boolean bopfuse_complex J6" test script
const Handle(Geom_Curve)& aC = Handle(Geom_TrimmedCurve)::DownCast (C3d)->BasisCurve();
f = aC->FirstParameter();
l = aC->LastParameter();
IsPeriodic = aC->IsPeriodic();
IsPeriodic = aC->IsPeriodic111();
if(IsPeriodic)
{
aPeriod = aC->Period();
@@ -224,7 +226,7 @@ void BRepCheck_Edge::Minimum()
Sref = Handle(Geom_Surface)::DownCast
(Sref->Transformed(myCref->Location().Transformation()));
const Handle(Geom2d_Curve)& PCref = myCref->PCurve();
Standard_Boolean IsPeriodic = PCref->IsPeriodic();
Standard_Boolean IsPeriodic = PCref->IsPeriodic111();
Standard_Real aPeriod = RealLast();
if(IsPeriodic)
{
@@ -233,10 +235,11 @@ void BRepCheck_Edge::Minimum()
Standard_Real f = PCref->FirstParameter(), l = PCref->LastParameter();
if (PCref->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
// E.g. see "boolean bopfuse_complex J6" test script
const Handle(Geom2d_Curve)& aC = Handle(Geom2d_TrimmedCurve)::DownCast (PCref)->BasisCurve();
f = aC->FirstParameter();
l = aC->LastParameter();
IsPeriodic = aC->IsPeriodic();
IsPeriodic = aC->IsPeriodic111();
if(IsPeriodic)
{
aPeriod = aC->Period();
@@ -360,7 +363,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
// Modified by skv - Tue Apr 27 11:50:37 2004 End
//
const Handle(Geom2d_Curve)& pc = cr->PCurve();
Standard_Boolean IsPeriodic = pc->IsPeriodic();
Standard_Boolean IsPeriodic = pc->IsPeriodic111();
Standard_Real aPeriod = RealLast();
if(IsPeriodic)
{
@@ -369,10 +372,12 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Standard_Real fp = pc->FirstParameter(), lp = pc->LastParameter();
if (pc->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
// E.g. see "boolean bopfuse_complex J6" test script
const Handle(Geom2d_Curve)& aC = Handle(Geom2d_TrimmedCurve)::DownCast (pc)->BasisCurve();
fp = aC->FirstParameter();
lp = aC->LastParameter();
IsPeriodic = aC->IsPeriodic();
IsPeriodic = aC->IsPeriodic111();
if(IsPeriodic)
{
aPeriod = aC->Period();

View File

@@ -997,7 +997,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
//
C1.Load(pcu);
// To avoid exeption in Segment if C1 is BSpline - IFV
if(!C1.IsPeriodic()) {
if(!C1.IsPeriodic222()) {
if(C1.FirstParameter() > first1) {
first1 = C1.FirstParameter();
}
@@ -1086,7 +1086,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
if (!tabCur(j).IsNull() && last2 > first2) {
C2.Load(tabCur(j));
// To avoid exeption in Segment if C2 is BSpline - IFV
if(!C2.IsPeriodic()) {
if(!C2.IsPeriodic222()) {
if(C2.FirstParameter() > first2) {
first2 = C2.FirstParameter();
}

View File

@@ -142,13 +142,6 @@ void BRepClass_Intersector::Perform(const gp_Lin2d& L,
}
IntRes2d_Domain DE(pdeb,deb,toldeb,pfin,fin,tolfin);
// temporary periodic domain
if (C.Curve()->IsPeriodic()) {
DE.SetEquivalentParameters(C.FirstParameter(),
C.FirstParameter() +
C.Curve()->LastParameter() -
C.Curve()->FirstParameter());
}
Handle(Geom2d_Line) GL= new Geom2d_Line(L);
Geom2dAdaptor_Curve CGA(GL);

View File

@@ -49,8 +49,8 @@ void BRepClass3d_Intersector3d::Perform(const gp_Lin& L,
surface.Initialize(Face,Standard_True);
const Standard_Boolean IsUPer = surface.IsUPeriodic();
const Standard_Boolean IsVPer = surface.IsVPeriodic();
const Standard_Boolean IsUPer = surface.IsUPeriodic222();
const Standard_Boolean IsVPer = surface.IsVPeriodic222();
const Standard_Real uperiod = IsUPer ? surface.UPeriod() : 0.0;
const Standard_Real vperiod = IsVPer ? surface.VPeriod() : 0.0;

View File

@@ -271,16 +271,15 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
Standard_Real v,dv = (V2-V1)/6.0;
if(du<1e-12) du=1e-12;
if(dv<1e-12) dv=1e-12;
Standard_Boolean IsNotUper = !surf->IsUPeriodic(), IsNotVper = !surf->IsVPeriodic();
Standard_Integer NbPntCalc=0;
if(myMapOfInter.IsBound(Face)) {
void *ptr = (void*)(myMapOfInter.Find(Face));
Standard_Boolean IsInside = Standard_True;
if(IsNotUper)
if (!surf->IsUPeriodic222())
{
IsInside = (u_ >= U1) && (u_ <= U2);
}
if(IsNotVper)
if (!surf->IsVPeriodic222())
{
IsInside &= (v_ >= V1) && (v_ <= V2);
}

View File

@@ -442,12 +442,12 @@ Standard_Boolean BRepFeat::IsInside(const TopoDS_Face& F1,
// Standard_Real periodu, periodv;
BRepTools::UVBounds(F2,umin,umax,vmin,vmax);
if (S->IsUPeriodic()) {
if (S->IsUPeriodic111()) {
flagu = 1;
uperiod = S->UPeriod();
}
if (S->IsVPeriodic()) {
if (S->IsVPeriodic111()) {
flagv = 1;
vperiod = S->VPeriod();
}

View File

@@ -153,6 +153,7 @@ static void Descendants(const TopoDS_Shape&,
TopTools_ListIteratorOfListOfShape it,it2;
Standard_Integer sens = 0;
// Almost all curves in scur are trimmed curve (e.g. see LocOpe_DPrism::Curves(...))
TColGeom_SequenceOfCurve scur;
Curves(scur);
@@ -196,7 +197,7 @@ static void Descendants(const TopoDS_Shape&,
}
mu = ASI2.Point(jj,1).Parameter();
Mu = ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter();
if (!scur(jj)->IsPeriodic()) {
if (!scur(jj)->IsPeriodic111()) {
Standard_Integer ku, kf;
if (! (mu > Mf || mf > Mu)) { //overlapping intervals
sens = 1;
@@ -691,7 +692,7 @@ static void Descendants(const TopoDS_Shape&,
prmin2, prmax2, prbmin2, prbmax2, flag1);
// case of revolutions
if (C->IsPeriodic()) {
if (C->IsPeriodic111()) {
Standard_Real period = C->Period();
prmax = prmax2;
if (flag1) {
@@ -906,7 +907,7 @@ static void Descendants(const TopoDS_Shape&,
Standard_Real min, max, pmin, pmax;
Standard_Boolean flag2;
for (it.Initialize(lshape); it.More(); it.Next()) {
if (C->IsPeriodic()) {
if (C->IsPeriodic111()) {
Standard_Real period = C->Period();
Standard_Real pr, prb;
BRepFeat::ParametricMinMax(it.Value(),C, pr, prmax1,

View File

@@ -213,15 +213,16 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
// try duplication
GeomAdaptor_Surface GAS1(S);
GeomAbs_SurfaceType Type1 = GAS1.GetType();
if ( UU1->IsPeriodic()) {
if (UU1->IsPeriodic111() && UU1->IsClosed())
{
ElCLib::AdjustPeriodic(UU1->FirstParameter(),
UU1->LastParameter(),
Precision::PConfusion(),
Umin, Umax);
}
if ( VV1->IsPeriodic()) {
if (VV1->IsPeriodic111() && VV1->IsClosed())
{
ElCLib::AdjustPeriodic(VV1->FirstParameter(),
VV1->LastParameter(),
Precision::PConfusion(),
@@ -319,15 +320,16 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
// try duplication
GeomAdaptor_Surface GAS2(S);
GeomAbs_SurfaceType Type2 = GAS2.GetType();
if ( UU2->IsPeriodic()) {
if (UU2->IsPeriodic111() && UU2->IsClosed())
{
ElCLib::AdjustPeriodic(UU2->FirstParameter(),
UU2->LastParameter(),
Precision::PConfusion(),
Umin, Umax);
}
if ( VV2->IsPeriodic()) {
if (VV2->IsPeriodic111() && VV2->IsClosed())
{
ElCLib::AdjustPeriodic(VV2->FirstParameter(),
VV2->LastParameter(),
Precision::PConfusion(),
@@ -368,7 +370,8 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
if ( myKPart == 1)
myCont = GeomAbs_G1;
if ( (Type1 == GeomAbs_Plane) && (Type2 == GeomAbs_Plane)) {
if ((GAS1.GetType() == GeomAbs_Plane) && (GAS2.GetType() == GeomAbs_Plane))
{
myKPart = 2;
}
}

View File

@@ -100,6 +100,7 @@
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <GeomLib.hxx>
#include <stdio.h>
#ifdef OCCT_DEBUG
@@ -1292,14 +1293,8 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
TopoDS_Vertex V1,V2;
const Handle(Geom2d_Curve)& Bis = Bisec.Value();
Standard_Boolean ForceAdd = Standard_False;
Handle(Geom2d_TrimmedCurve) aTC = Handle(Geom2d_TrimmedCurve)::DownCast(Bis);
if(!aTC.IsNull() && aTC->BasisCurve()->IsPeriodic())
{
gp_Pnt2d Pf = Bis->Value(Bis->FirstParameter());
gp_Pnt2d Pl = Bis->Value(Bis->LastParameter());
ForceAdd = Pf.Distance(Pl) <= Precision::Confusion();
}
const Standard_Boolean ForceAdd = (Bis->IsPeriodic111() &&
GeomLib::IsClosed(Bis, Precision::Confusion()));
U1 = Bis->FirstParameter();

View File

@@ -82,7 +82,7 @@ GeomAbs_Shape BRepLProp::Continuity(const BRepAdaptor_Curve& C1,
}
const TopoDS_Edge& E1 = C1.Edge();
const TopoDS_Edge& E2 = C2.Edge();
if (E1.IsSame(E2) && C1.IsPeriodic() && cont >= GeomAbs_G1)
if (E1.IsSame(E2) && C1.IsPeriodic222() && cont >= GeomAbs_G1)
cont = GeomAbs_CN;
return cont;
}

View File

@@ -1076,7 +1076,7 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_HCurve)& c3d,
Standard_Real uf = surf->FirstUParameter(), ul = surf->LastUParameter(),
vf = surf->FirstVParameter(), vl = surf->LastVParameter();
Standard_Real du = 0.01 * (ul - uf), dv = 0.01 * (vl - vf);
Standard_Boolean isUPeriodic = surf->IsUPeriodic(), isVPeriodic = surf->IsVPeriodic();
Standard_Boolean isUPeriodic = surf->IsUPeriodic222(), isVPeriodic = surf->IsVPeriodic222();
Standard_Real DSdu = 1./surf->UResolution(1.), DSdv = 1./surf->VResolution(1.);
Standard_Real d2 = 0.;
Standard_Real first = c3d->FirstParameter();
@@ -1283,30 +1283,21 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d();
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
// modified by NIZHNY-OCC486 Tue Aug 27 17:15:13 2002 :
Standard_Boolean m_TrimmedPeriodical = Standard_False;
Handle(Standard_Type) TheType = C3d->DynamicType();
if( TheType == STANDARD_TYPE(Geom_TrimmedCurve))
if (C3d->IsPeriodic111())
{
Handle(Geom_Curve) gtC (Handle(Geom_TrimmedCurve)::DownCast (C3d)->BasisCurve());
m_TrimmedPeriodical = gtC->IsPeriodic();
// Range of the curve cannot be greater than period.
// If it is greater then it must be reduced.
const Standard_Real aDelta = Max(l3d - f3d - C3d->Period(), 0.0)/2.0;
f3d += aDelta;
l3d -= aDelta;
}
// modified by NIZHNY-OCC486 Tue Aug 27 17:15:17 2002 .
if(!C3d->IsPeriodic()) {
Standard_Real Udeb = C3d->FirstParameter();
Standard_Real Ufin = C3d->LastParameter();
// modified by NIZHNY-OCC486 Tue Aug 27 17:17:14 2002 :
//if (Udeb > f3d) f3d = Udeb;
//if (l3d > Ufin) l3d = Ufin;
if(!m_TrimmedPeriodical)
{
if (Udeb > f3d) f3d = Udeb;
if (l3d > Ufin) l3d = Ufin;
}
// modified by NIZHNY-OCC486 Tue Aug 27 17:17:55 2002 .
if (!GeomLib::AllowExtend(*C3d, f3d, l3d))
{
if (C3d->FirstParameter() > f3d) f3d = C3d->FirstParameter();
if (l3d > C3d->LastParameter()) l3d = C3d->LastParameter();
}
if(!L3d.IsIdentity()){
C3d = Handle(Geom_Curve)::DownCast(C3d->Transformed(L3d.Transformation()));
}
@@ -1384,7 +1375,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d, Tol2d);
isBSP = Standard_True;
if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
gp_Pnt2d NewOriginPoint;
bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||
@@ -1429,7 +1420,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d,Tol2dbail);
if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
gp_Pnt2d NewOriginPoint;
bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||
@@ -2711,7 +2702,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF,
Standard_Real aSUMin, aSUMax, aSVMin, aSVMax;
aSurf->Bounds(aSUMin, aSUMax, aSVMin, aSVMax);
Standard_Boolean isUPeriodic = aBAS.IsUPeriodic();
Standard_Boolean isUPeriodic = aBAS.IsUPeriodic222();
Standard_Real anUPeriod = isUPeriodic ? aBAS.UPeriod() : 0.0;
if (isUPeriodic)
{
@@ -2721,7 +2712,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF,
aFUMax = aFUMin + aDelta;
}
Standard_Boolean isVPeriodic = aBAS.IsVPeriodic();
Standard_Boolean isVPeriodic = aBAS.IsVPeriodic222();
Standard_Real aVPeriod = isVPeriodic ? aBAS.VPeriod() : 0.0;
if (isVPeriodic)
{

View File

@@ -768,13 +768,9 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
const Standard_Real pp1,
const Standard_Real pp2)
{
// kill trimmed curves
Handle(Geom_Curve) C = CC;
Handle(Geom_TrimmedCurve) CT = Handle(Geom_TrimmedCurve)::DownCast(C);
while (!CT.IsNull()) {
C = CT->BasisCurve();
CT = Handle(Geom_TrimmedCurve)::DownCast(C);
}
// kill trimmed curves to obtain First/Last-parameters of basis curve
const Handle(Geom_Curve) C = (CC->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ?
Handle(Geom_TrimmedCurve)::DownCast(CC)->BasisCurve() : CC;
// check parameters
Standard_Real p1 = pp1;
@@ -782,18 +778,18 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
GeomAdaptor_Curve aCA(C);
TopoDS_Vertex V1,V2;
if (periodic) {
if (C->IsPeriodic111())
{
// adjust in period
ElCLib::AdjustPeriodic(cf,cl,epsilon,p1,p2);
V1 = VV1;
V2 = VV2;
}
else {
// reordonate
// reordinate
if (p1 < p2) {
V1 = VV1;
V2 = VV2;
@@ -801,9 +797,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
else {
V2 = VV1;
V1 = VV2;
Standard_Real x = p1;
p1 = p2;
p2 = x;
std::swap(p1, p2);
}
// check range
@@ -1059,7 +1053,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
Standard_Boolean periodic = C->IsPeriodic111();
TopoDS_Vertex V1,V2;

View File

@@ -594,7 +594,7 @@ void BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::Confusion();
Standard_Boolean periodic = C->IsPeriodic();
Standard_Boolean periodic = C->IsPeriodic111();
TopoDS_Vertex V1,V2;

View File

@@ -537,7 +537,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS,
}
}
if (S->IsUPeriodic()) {
if (S->IsUPeriodic111()) {
ElCLib::AdjustPeriodic(umin,umax,epsilon,UMin,UMax);
}
else if (UMin > UMax) {
@@ -550,7 +550,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS,
}
}
if (S->IsVPeriodic()) {
if (S->IsVPeriodic111()) {
ElCLib::AdjustPeriodic(vmin,vmax,epsilon,VMin,VMax);
}
else if (VMin > VMax) {

View File

@@ -90,23 +90,17 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S,
const Standard_Real VMax,
const Standard_Boolean Segment)
{
Handle(Geom_Surface) BS = S;
if ( S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
Handle(Geom_RectangularTrimmedSurface) RTS =
Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
BS = RTS->BasisSurface();
}
myError = BRepLib_EmptyShell;
Standard_Real tol = Precision::Confusion();
// Make a shell from a surface
GeomAdaptor_Surface GS(BS,UMin,UMax,VMin,VMax);
GeomAdaptor_Surface GS(S,UMin,UMax,VMin,VMax);
Standard_Integer nu = GS.NbUIntervals(GeomAbs_C2);
Standard_Integer nv = GS.NbVIntervals(GeomAbs_C2);
Standard_Boolean uperiodic = GS.IsUPeriodic();
Standard_Boolean vperiodic = GS.IsVPeriodic();
Standard_Boolean uperiodic = GS.IsUPeriodic222();
Standard_Boolean vperiodic = GS.IsVPeriodic222();
if (nu == 0 || nv == 0) return;
@@ -182,6 +176,8 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S,
}
}
Handle(Geom_Surface) SS = Handle(Geom_Surface)::DownCast(GS.Surface()->Copy());
for (iv = 1; iv <= nv; iv++) {
// compute the first edge and vertices of the line
@@ -222,7 +218,6 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S,
// create the face at iu, iv
// the surface
Handle(Geom_Surface) SS = Handle(Geom_Surface)::DownCast(BS->Copy());
if (GS.GetType() == GeomAbs_BSplineSurface && Segment) {
Handle(Geom_BSplineSurface)::DownCast(SS)
->Segment(upars(iu),upars(iu+1),

View File

@@ -233,11 +233,14 @@ Standard_Boolean BRepMesh_CurveTessellator::Value (
aSurface->GetType() != GeomAbs_BezierSurface &&
aSurface->GetType() != GeomAbs_OtherSurface)
{
// For trimmed cone/cylinder.
// Return independently of the fact whether the surface trimmed.
return Standard_True;
}
// Let skip periodic case.
if (aSurface->IsUPeriodic() || aSurface->IsVPeriodic())
if (aSurface->IsUPeriodic222() || aSurface->IsVPeriodic222())
{
return Standard_True;
}

View File

@@ -53,7 +53,8 @@ void BRepMesh_DefaultRangeSplitter::AdjustRange()
{
const Handle(BRepAdaptor_HSurface)& aSurface = GetSurface();
updateRange(aSurface->FirstUParameter(), aSurface->LastUParameter(),
aSurface->IsUPeriodic(), myRangeU.first, myRangeU.second);
aSurface->IsUPeriodic222() && aSurface->IsUClosed(),
myRangeU.first, myRangeU.second);
if (myRangeU.second < myRangeU.first)
{
@@ -62,7 +63,8 @@ void BRepMesh_DefaultRangeSplitter::AdjustRange()
}
updateRange(aSurface->FirstVParameter(), aSurface->LastVParameter(),
aSurface->IsVPeriodic(), myRangeV.first, myRangeV.second);
aSurface->IsVPeriodic222() && aSurface->IsVClosed(),
myRangeV.first, myRangeV.second);
if (myRangeV.second < myRangeV.first)
{

View File

@@ -951,6 +951,9 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
if (theCurve->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve)) &&
(FirstPar > anEf - a2Offset || LastPar < anEl + a2Offset))
{
// Trimmed curves or periodic B-spline curves are processed
// in this branch.
Handle(Geom2d_Curve) NewPCurve;
if (ExtendPCurve(theCurve, anEf, anEl, a2Offset, NewPCurve))
{
@@ -965,7 +968,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
}
}
}
else if (theCurve->IsPeriodic())
else if (theCurve->IsPeriodic111())
{
Standard_Real delta = (theCurve->Period() - (anEl - anEf))*0.5;
delta *= 0.95;
@@ -1111,7 +1114,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
f = FirstParOnPC;
l = LastParOnPC;
}
else if (C3d->IsPeriodic())
else if (C3d->IsPeriodic111())
{
Standard_Real delta = (C3d->Period() - (l - f))*0.5;
delta *= 0.95;
@@ -1317,7 +1320,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
LastPar = C3d->LastParameter();
BB.UpdateEdge(NE, C3d, Precision::Confusion());
}
else if (C3d->IsPeriodic())
else if (C3d->IsPeriodic111())
{
Standard_Real delta = (C3d->Period() - (anEl - anEf))*0.5;
delta *= 0.95;

View File

@@ -2547,7 +2547,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
Standard_Real aF, aL;
const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL);
if (!aC.IsNull() &&
(!aC->IsClosed() && !aC->IsPeriodic()))
(!aC->IsClosed() && !aC->IsPeriodic111()))
{
gp_Pnt aPntF = BRep_Tool::Pnt(V1);
gp_Pnt aPntL = BRep_Tool::Pnt(V2);

View File

@@ -252,19 +252,16 @@ static void PutInBounds (const TopoDS_Face& F,
BRep_Tool::Range(E,f,l);
TopLoc_Location L; // Recup S avec la location pour eviter la copie.
Handle (Geom_Surface) S = BRep_Tool::Surface(F,L);
const Handle (Geom_Surface) &S = BRep_Tool::Surface(F,L);
if (S->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
}
//---------------
// Recadre en U.
//---------------
if (!S->IsUPeriodic() && !S->IsVPeriodic()) return;
if (!S->IsUPeriodic111() && !S->IsVPeriodic111()) return;
FindPeriod (F,umin,umax,vmin,vmax);
if (S->IsUPeriodic()) {
if (S->IsUPeriodic111()) {
Standard_Real period = S->UPeriod();
Standard_Real eps = period*1.e-6;
gp_Pnt2d Pf = C2d->Value(f);
@@ -298,7 +295,7 @@ static void PutInBounds (const TopoDS_Face& F,
//------------------
// Recadre en V.
//------------------
if (S->IsVPeriodic()) {
if (S->IsVPeriodic111()) {
Standard_Real period = S->VPeriod();
Standard_Real eps = period*1.e-6;
gp_Pnt2d Pf = C2d->Value(f);
@@ -433,7 +430,7 @@ static void BuildPCurves (const TopoDS_Edge& E,
C2d = BRep_Tool::CurveOnSurface( theEdge, theFace, f, l );
C2d = new Geom2d_TrimmedCurve( C2d, U1, U2 );
if (theSurf->IsUPeriodic() || theSurf->IsVPeriodic())
if (theSurf->IsUPeriodic111() || theSurf->IsVPeriodic111())
PutInBounds( F, E, C2d );
BRep_Builder B;
@@ -482,7 +479,7 @@ static void BuildPCurves (const TopoDS_Edge& E,
break;
}
if (AS.IsUPeriodic() || AS.IsVPeriodic()) {
if (AS.IsUPeriodic222() || AS.IsVPeriodic222()) {
PutInBounds(F,E,C2d);
}
if (!C2d.IsNull()) {
@@ -908,7 +905,7 @@ static Standard_Boolean AreConnex(const TopoDS_Wire& W1,
if (V11.IsSame(V21) || V11.IsSame(V22) ||
V12.IsSame(V21) || V12.IsSame(V22))
return Standard_True;
return Standard_True;
return Standard_False;
}
@@ -1248,8 +1245,8 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1,
//=======================================================================
static void CheckIntersFF(const BOPDS_PDS& pDS,
const TopoDS_Edge& RefEdge,
TopTools_IndexedMapOfShape& TrueEdges)
const TopoDS_Edge& RefEdge,
TopTools_IndexedMapOfShape& TrueEdges)
{
BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF();
Standard_Integer aNb = aFFs.Length();
@@ -1260,33 +1257,33 @@ static void CheckIntersFF(const BOPDS_PDS& pDS,
BB.MakeCompound(Edges);
for (i = 0; i < aNb; ++i)
{
BOPDS_InterfFF& aFFi=aFFs(i);
const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
Standard_Integer aNbCurves = aBCurves.Length();
for (j = 0; j < aNbCurves; ++j)
{
const BOPDS_Curve& aBC=aBCurves(j);
const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks();
BOPDS_InterfFF& aFFi=aFFs(i);
const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves();
Standard_Integer aNbCurves = aBCurves.Length();
BOPDS_ListIteratorOfListOfPaveBlock aPBIt;
aPBIt.Initialize(aSectEdges);
for (; aPBIt.More(); aPBIt.Next())
{
const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value();
Standard_Integer nSect = aPB->Edge();
const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect);
for (j = 0; j < aNbCurves; ++j)
{
const BOPDS_Curve& aBC=aBCurves(j);
const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks();
BOPDS_ListIteratorOfListOfPaveBlock aPBIt;
aPBIt.Initialize(aSectEdges);
for (; aPBIt.More(); aPBIt.Next())
{
const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value();
Standard_Integer nSect = aPB->Edge();
const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect);
BB.Add(Edges, anEdge);
nbe++;
}
nbe++;
}
}
}
}
if (nbe == 0)
return;
TopTools_ListOfShape CompList;
BOPTools_AlgoTools::MakeConnexityBlocks(Edges, TopAbs_VERTEX, TopAbs_EDGE, CompList);
@@ -1294,115 +1291,115 @@ static void CheckIntersFF(const BOPDS_PDS& pDS,
if (CompList.Extent() == 1)
NearestCompound = CompList.First();
else
{
{
BRepAdaptor_Curve BAcurve(RefEdge);
gp_Pnt Pref = BAcurve.Value((BAcurve.FirstParameter()+BAcurve.LastParameter())/2);
TopoDS_Vertex Vref = BRepLib_MakeVertex(Pref);
Standard_Real MinDist = RealLast();
TopTools_ListIteratorOfListOfShape itl(CompList);
for (; itl.More(); itl.Next())
{
{
const TopoDS_Shape& aCompound = itl.Value();
BRepExtrema_DistShapeShape Projector(Vref, aCompound);
if (!Projector.IsDone() || Projector.NbSolution() == 0)
continue;
Standard_Real aDist = Projector.Value();
if (aDist < MinDist)
{
{
MinDist = aDist;
NearestCompound = aCompound;
}
}
}
}
TopExp::MapShapes(NearestCompound, TopAbs_EDGE, TrueEdges);
}
}
//=======================================================================
//function : AssembleEdge
//purpose :
//=======================================================================
static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS,
const TopoDS_Face& F1,
const TopoDS_Face& F2,
const Standard_Boolean addPCurve1,
const Standard_Boolean addPCurve2,
const TopTools_SequenceOfShape& EdgesForConcat)
const TopoDS_Face& F1,
const TopoDS_Face& F2,
const Standard_Boolean addPCurve1,
const Standard_Boolean addPCurve2,
const TopTools_SequenceOfShape& EdgesForConcat)
{
TopoDS_Edge NullEdge;
TopoDS_Edge CurEdge = TopoDS::Edge( EdgesForConcat(1) );
Standard_Real aGlueTol = Precision::Confusion();
for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
{
TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) );
Standard_Boolean After = Standard_False;
TopoDS_Vertex Vfirst, Vlast;
{
TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) );
Standard_Boolean After = Standard_False;
TopoDS_Vertex Vfirst, Vlast;
Standard_Boolean AreClosedWire = AreClosed( CurEdge, anEdge );
if (AreClosedWire)
{
TopoDS_Vertex V1, V2;
TopExp::Vertices( CurEdge, V1, V2 );
{
TopoDS_Vertex V1, V2;
TopExp::Vertices( CurEdge, V1, V2 );
Standard_Boolean IsAutonomV1 = IsAutonomVertex( V1, pDS, F1, F2 );
Standard_Boolean IsAutonomV2 = IsAutonomVertex( V2, pDS, F1, F2 );
if (IsAutonomV1)
{
After = Standard_False;
Vfirst = Vlast = V2;
}
{
After = Standard_False;
Vfirst = Vlast = V2;
}
else if (IsAutonomV2)
{
After = Standard_True;
Vfirst = Vlast = V1;
}
{
After = Standard_True;
Vfirst = Vlast = V1;
}
else
return NullEdge;
}
else
{
TopoDS_Vertex CV, V11, V12, V21, V22;
TopExp::CommonVertex( CurEdge, anEdge, CV );
}
else
{
TopoDS_Vertex CV, V11, V12, V21, V22;
TopExp::CommonVertex( CurEdge, anEdge, CV );
Standard_Boolean IsAutonomCV = IsAutonomVertex( CV, pDS, F1, F2 );
if (IsAutonomCV)
{
aGlueTol = BRep_Tool::Tolerance(CV);
TopExp::Vertices( CurEdge, V11, V12 );
TopExp::Vertices( anEdge, V21, V22 );
if (V11.IsSame(CV) && V21.IsSame(CV))
{
Vfirst = V22;
Vlast = V12;
}
else if (V11.IsSame(CV) && V22.IsSame(CV))
{
Vfirst = V21;
Vlast = V12;
}
else if (V12.IsSame(CV) && V21.IsSame(CV))
{
Vfirst = V11;
Vlast = V22;
}
else
{
Vfirst = V11;
Vlast = V21;
}
aGlueTol = BRep_Tool::Tolerance(CV);
TopExp::Vertices( CurEdge, V11, V12 );
TopExp::Vertices( anEdge, V21, V22 );
if (V11.IsSame(CV) && V21.IsSame(CV))
{
Vfirst = V22;
Vlast = V12;
}
else if (V11.IsSame(CV) && V22.IsSame(CV))
{
Vfirst = V21;
Vlast = V12;
}
else if (V12.IsSame(CV) && V21.IsSame(CV))
{
Vfirst = V11;
Vlast = V22;
}
else
{
Vfirst = V11;
Vlast = V21;
}
}
else
return NullEdge;
} //end of else (open wire)
TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After,
F1, addPCurve1, F2, addPCurve2, aGlueTol);
} //end of else (open wire)
TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After,
F1, addPCurve1, F2, addPCurve2, aGlueTol);
if (NewEdge.IsNull())
return NullEdge;
else
CurEdge = NewEdge;
} //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
} //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++)
return CurEdge;
}
@@ -1499,43 +1496,29 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
continue;
Standard_Real f, l;
const Handle(Geom_Curve)& aC3DE = BRep_Tool::Curve(anEdge, f, l);
Handle(Geom_TrimmedCurve) aC3DETrim;
if(!aC3DE.IsNull())
aC3DETrim = new Geom_TrimmedCurve(aC3DE, f, l);
const Handle(Geom_Curve)& aC3DE = BRep_Tool::Curve(anEdge, f, l);
Standard_Real aTolEdge = BRep_Tool::Tolerance(anEdge);
if (!BOPTools_AlgoTools2D::HasCurveOnSurface(anEdge, F1)) {
Handle(Geom2d_Curve) aC2d = aBC.Curve().FirstCurve2d();
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
if (!aC3DE.IsNull())
{
Handle(Geom2d_Curve) aC2dNew;
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F1, aTolEdge);
}
if (!BOPTools_AlgoTools2D::HasCurveOnSurface(anEdge, F2)) {
Handle(Geom2d_Curve) aC2d = aBC.Curve().SecondCurve2d();
if(!aC3DETrim.IsNull()) {
Handle(Geom2d_Curve) aC2dNew;
if(aC3DE->IsPeriodic()) {
if (!aC3DE.IsNull())
{
Handle(Geom2d_Curve) aC2dNew;
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, f, l, aC2d, aC2dNew, aContext);
}
else {
BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, aC3DETrim, aC2d, aC2dNew, aContext);
}
aC2d = aC2dNew;
}
aC2d = aC2dNew;
}
BB.UpdateEdge(anEdge, aC2d, F2, aTolEdge);
}
@@ -1582,11 +1565,11 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
if (L1.Extent() > 1 && (!isEl1 || !isEl2)) {
TopTools_SequenceOfShape eseq;
TopTools_SequenceOfShape EdgesForConcat;
if (!TrueEdges.IsEmpty())
{
for (i = TrueEdges.Extent(); i >= 1; i--)
EdgesForConcat.Append( TrueEdges(i) );
{
for (i = TrueEdges.Extent(); i >= 1; i--)
EdgesForConcat.Append( TrueEdges(i) );
TopoDS_Edge AssembledEdge =
AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, EdgesForConcat );
if (AssembledEdge.IsNull())
@@ -1594,145 +1577,145 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
eseq.Append( TrueEdges(i) );
else
eseq.Append(AssembledEdge);
}
}
else
{
TopTools_SequenceOfShape wseq;
TopTools_SequenceOfShape edges;
TopTools_ListIteratorOfListOfShape itl(L1);
for (; itl.More(); itl.Next())
edges.Append( itl.Value() );
while (!edges.IsEmpty())
{
TopoDS_Edge anEdge = TopoDS::Edge( edges.First() );
TopTools_SequenceOfShape wseq;
TopTools_SequenceOfShape edges;
TopTools_ListIteratorOfListOfShape itl(L1);
for (; itl.More(); itl.Next())
edges.Append( itl.Value() );
while (!edges.IsEmpty())
{
TopoDS_Edge anEdge = TopoDS::Edge( edges.First() );
TopoDS_Wire aWire, resWire;
BB.MakeWire(aWire);
BB.Add( aWire, anEdge );
TColStd_SequenceOfInteger Candidates;
for (k = 1; k <= wseq.Length(); k++)
{
resWire = TopoDS::Wire(wseq(k));
TColStd_SequenceOfInteger Candidates;
for (k = 1; k <= wseq.Length(); k++)
{
resWire = TopoDS::Wire(wseq(k));
if (AreConnex( resWire, aWire ))
{
Candidates.Append( 1 );
break;
}
}
if (Candidates.IsEmpty())
{
wseq.Append( aWire );
edges.Remove(1);
}
else
{
for (j = 2; j <= edges.Length(); j++)
{
anEdge = TopoDS::Edge( edges(j) );
{
Candidates.Append( 1 );
break;
}
}
if (Candidates.IsEmpty())
{
wseq.Append( aWire );
edges.Remove(1);
}
else
{
for (j = 2; j <= edges.Length(); j++)
{
anEdge = TopoDS::Edge( edges(j) );
aWire.Nullify();
BB.MakeWire(aWire);
BB.Add( aWire, anEdge );
if (AreConnex( resWire, aWire ))
Candidates.Append( j );
}
Standard_Integer minind = 1;
if (Candidates.Length() > 1)
{
Standard_Real MinAngle = RealLast();
for (j = 1; j <= Candidates.Length(); j++)
{
anEdge = TopoDS::Edge( edges(Candidates(j)) );
Standard_Real anAngle = AngleWireEdge( resWire, anEdge );
if (anAngle < MinAngle)
{
MinAngle = anAngle;
minind = j;
}
}
}
Candidates.Append( j );
}
Standard_Integer minind = 1;
if (Candidates.Length() > 1)
{
Standard_Real MinAngle = RealLast();
for (j = 1; j <= Candidates.Length(); j++)
{
anEdge = TopoDS::Edge( edges(Candidates(j)) );
Standard_Real anAngle = AngleWireEdge( resWire, anEdge );
if (anAngle < MinAngle)
{
MinAngle = anAngle;
minind = j;
}
}
}
BB.Add( resWire, TopoDS::Edge(edges(Candidates(minind))) );
wseq(k) = resWire;
edges.Remove(Candidates(minind));
}
} //end of while (!edges.IsEmpty())
for (i = 1; i <= wseq.Length(); i++)
{
TopoDS_Wire aWire = TopoDS::Wire(wseq(i));
TopTools_SequenceOfShape aLocalEdgesForConcat;
if (aWire.Closed())
{
TopoDS_Vertex StartVertex;
TopoDS_Edge StartEdge;
Standard_Boolean StartFound = Standard_False;
TopTools_ListOfShape Elist;
TopoDS_Iterator itw(aWire);
for (; itw.More(); itw.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itw.Value());
if (StartFound)
Elist.Append(anEdge);
else
{
TopoDS_Vertex V1, V2;
TopExp::Vertices( anEdge, V1, V2 );
if (!IsAutonomVertex( V1, pDS ))
{
StartVertex = V2;
StartEdge = anEdge;
StartFound = Standard_True;
}
else if (!IsAutonomVertex( V2, pDS ))
{
StartVertex = V1;
StartEdge = anEdge;
StartFound = Standard_True;
}
else
Elist.Append(anEdge);
}
} //end of for (; itw.More(); itw.Next())
if (!StartFound)
{
itl.Initialize(Elist);
StartEdge = TopoDS::Edge(itl.Value());
Elist.Remove(itl);
TopoDS_Vertex V1, V2;
TopExp::Vertices( StartEdge, V1, V2 );
StartVertex = V1;
}
aLocalEdgesForConcat.Append( StartEdge );
while (!Elist.IsEmpty())
{
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
TopoDS_Vertex V1, V2;
TopExp::Vertices( anEdge, V1, V2 );
if (V1.IsSame(StartVertex))
{
StartVertex = V2;
aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
else if (V2.IsSame(StartVertex))
{
StartVertex = V1;
aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
}
} //end of while (!Elist.IsEmpty())
} //end of if (aWire.Closed())
else
{
BRepTools_WireExplorer Wexp( aWire );
for (; Wexp.More(); Wexp.Next())
aLocalEdgesForConcat.Append( Wexp.Current() );
}
edges.Remove(Candidates(minind));
}
} //end of while (!edges.IsEmpty())
for (i = 1; i <= wseq.Length(); i++)
{
TopoDS_Wire aWire = TopoDS::Wire(wseq(i));
TopTools_SequenceOfShape aLocalEdgesForConcat;
if (aWire.Closed())
{
TopoDS_Vertex StartVertex;
TopoDS_Edge StartEdge;
Standard_Boolean StartFound = Standard_False;
TopTools_ListOfShape Elist;
TopoDS_Iterator itw(aWire);
for (; itw.More(); itw.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itw.Value());
if (StartFound)
Elist.Append(anEdge);
else
{
TopoDS_Vertex V1, V2;
TopExp::Vertices( anEdge, V1, V2 );
if (!IsAutonomVertex( V1, pDS ))
{
StartVertex = V2;
StartEdge = anEdge;
StartFound = Standard_True;
}
else if (!IsAutonomVertex( V2, pDS ))
{
StartVertex = V1;
StartEdge = anEdge;
StartFound = Standard_True;
}
else
Elist.Append(anEdge);
}
} //end of for (; itw.More(); itw.Next())
if (!StartFound)
{
itl.Initialize(Elist);
StartEdge = TopoDS::Edge(itl.Value());
Elist.Remove(itl);
TopoDS_Vertex V1, V2;
TopExp::Vertices( StartEdge, V1, V2 );
StartVertex = V1;
}
aLocalEdgesForConcat.Append( StartEdge );
while (!Elist.IsEmpty())
{
for (itl.Initialize(Elist); itl.More(); itl.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(itl.Value());
TopoDS_Vertex V1, V2;
TopExp::Vertices( anEdge, V1, V2 );
if (V1.IsSame(StartVertex))
{
StartVertex = V2;
aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
else if (V2.IsSame(StartVertex))
{
StartVertex = V1;
aLocalEdgesForConcat.Append( anEdge );
Elist.Remove(itl);
break;
}
}
} //end of while (!Elist.IsEmpty())
} //end of if (aWire.Closed())
else
{
BRepTools_WireExplorer Wexp( aWire );
for (; Wexp.More(); Wexp.Next())
aLocalEdgesForConcat.Append( Wexp.Current() );
}
TopoDS_Edge AssembledEdge =
AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, aLocalEdgesForConcat );
if (AssembledEdge.IsNull())
@@ -1740,56 +1723,56 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
eseq.Append( aLocalEdgesForConcat(j) );
else
eseq.Append( AssembledEdge );
}
} //end of else (when TrueEdges is empty)
}
} //end of else (when TrueEdges is empty)
if (eseq.Length() < L1.Extent())
{
L1.Clear();
L2.Clear();
for (i = 1; i <= eseq.Length(); i++)
{
L1.Clear();
L2.Clear();
for (i = 1; i <= eseq.Length(); i++)
{
TopoDS_Shape aShape = eseq(i);
TopoDS_Edge anEdge = TopoDS::Edge(eseq(i));
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge);
TopoDS_Edge anEdge = TopoDS::Edge(eseq(i));
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge);
#ifdef OCCT_DEBUG
cout<<"Tolerance of glued E = "<<EdgeTol<<endl;
cout<<"Tolerance of glued E = "<<EdgeTol<<endl;
#endif
if (EdgeTol > 1.e-2)
continue;
if (EdgeTol >= 1.e-4)
{
ReconstructPCurves(anEdge);
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
if (EdgeTol > 1.e-2)
continue;
if (EdgeTol >= 1.e-4)
{
ReconstructPCurves(anEdge);
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
#ifdef OCCT_DEBUG
cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
cout<<"After projection tol of E = "<<BRep_Tool::Tolerance(anEdge)<<endl;
#endif
}
OrientSection( anEdge, F1, F2, O1, O2 );
if (Side == TopAbs_OUT)
{
O1 = TopAbs::Reverse(O1);
O2 = TopAbs::Reverse(O2);
}
L1.Append( anEdge.Oriented(O1) );
L2.Append( anEdge.Oriented(O2) );
}
OrientSection( anEdge, F1, F2, O1, O2 );
if (Side == TopAbs_OUT)
{
O1 = TopAbs::Reverse(O1);
O2 = TopAbs::Reverse(O2);
}
L1.Append( anEdge.Oriented(O1) );
L2.Append( anEdge.Oriented(O2) );
}
}
}
} //end of if (L1.Extent() > 1)
else
{
TopTools_ListIteratorOfListOfShape itl(L1);
for (; itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge( itl.Value() );
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
TopTools_ListIteratorOfListOfShape itl(L1);
for (; itl.More(); itl.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge( itl.Value() );
BRepLib::SameParameter(anEdge, aSameParTol, Standard_True);
}
}
}
}
//=======================================================================
@@ -3079,7 +3062,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
Standard_Real UF1,VF1,UF2,VF2;
Standard_Boolean SurfaceChange = Standard_False;
if (S->IsUPeriodic() || S->IsVPeriodic()) {
if (S->IsUPeriodic111() || S->IsVPeriodic111()) {
// Calcul serre pour que les bornes ne couvre pas plus d une periode
CompactUVBounds(F,UF1,UF2,VF1,VF2);
}
@@ -3091,8 +3074,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
Standard_Real coeff;
if (ExtensionMode == 1)
{
UU1 = VV1 = - TheInfini;
UU2 = VV2 = TheInfini;
UU1 = VV1 = - TheInfini;
UU2 = VV2 = TheInfini;
coeff = 0.25;
}
else
@@ -3115,7 +3098,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
VV1 = Max(VS1,VV1); VV2 = Min(VS2,VV2);
}
if (S->IsUPeriodic()) {
if (S->IsUPeriodic111()) {
Standard_Real Period = S->UPeriod();
Standard_Real Delta = Period - (UF2 - UF1);
Standard_Real alpha = 0.1;
@@ -3124,7 +3107,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
UU2 = UU1 + Period;
}
}
if (S->IsVPeriodic()) {
if (S->IsVPeriodic111()) {
Standard_Real Period = S->VPeriod();
Standard_Real Delta = Period - (VF2 - VF1);
Standard_Real alpha = 0.1;

View File

@@ -262,11 +262,13 @@ static Standard_Integer pcurve(Draw_Interpretor& , Standard_Integer n, const cha
Sprintf(name,"%s_%d",a[1],i);
Standard_Real fr = c->FirstParameter(), lr = c->LastParameter();
Standard_Boolean IsPeriodic = c->IsPeriodic();
Standard_Boolean IsPeriodic = c->IsPeriodic111();
if (c->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
// E.g. see "boolean bopfuse_complex J6" test script
const Handle(Geom2d_Curve)& aC = Handle(Geom2d_TrimmedCurve)::DownCast (c)->BasisCurve();
IsPeriodic = aC->IsPeriodic();
IsPeriodic = aC->IsPeriodic111();
fr = aC->FirstParameter();
lr = aC->LastParameter();
}
@@ -294,11 +296,11 @@ static Standard_Integer pcurve(Draw_Interpretor& , Standard_Integer n, const cha
const Handle(Geom2d_Curve) c = BRep_Tool::CurveOnSurface
(TopoDS::Edge(SE),TopoDS::Face(SF),f,l);
Standard_Real fr = c->FirstParameter(), lr = c->LastParameter();
Standard_Boolean IsPeriodic = c->IsPeriodic();
Standard_Boolean IsPeriodic = c->IsPeriodic111();
if (c->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
const Handle(Geom2d_Curve)& aC = Handle(Geom2d_TrimmedCurve)::DownCast (c)->BasisCurve();
IsPeriodic = aC->IsPeriodic();
IsPeriodic = aC->IsPeriodic111();
fr = aC->FirstParameter();
lr = aC->LastParameter();
}

View File

@@ -387,10 +387,10 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
Standard_Real uShift = 0., vShift = 0.;
Standard_Real U0, U1, V0, V1;
Surf->Bounds(U0, U1, V0, V1);
if (aBSpline->IsUPeriodic() && Abs(Ufirst - U0) > Precision::PConfusion()) {
if (aBSpline->IsUPeriodic111() && Abs(Ufirst - U0) > Precision::PConfusion()) {
uShift = ShapeAnalysis::AdjustToPeriod(Ufirst, U0, U1);
}
if (aBSpline->IsVPeriodic() && Abs(Vfirst - V0) > Precision::PConfusion()) {
if (aBSpline->IsVPeriodic111() && Abs(Vfirst - V0) > Precision::PConfusion()) {
vShift = ShapeAnalysis::AdjustToPeriod(Vfirst, V0, V1);
}
if (Abs(uShift) > Precision::PConfusion() || Abs(vShift) > Precision::PConfusion()) {

View File

@@ -63,6 +63,7 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <GeomLib.hxx>
#include <GeomLib_CheckCurveOnSurface.hxx>
#include <errno.h>
@@ -238,7 +239,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
}
//
if(!aS->IsUPeriodic())
if(!aS->IsUPeriodic111())
{
Standard_Boolean isUPeriodic = Standard_False;
@@ -319,7 +320,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
}
}
if(!aS->IsVPeriodic())
if(!aS->IsVPeriodic111())
{
Standard_Boolean isVPeriodic = Standard_False;
@@ -1020,12 +1021,32 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
//Set first, last to avoid ErrosStatus = 2 because of
//too strong checking of limits in class CheckCurveOnSurface
//
if(!C3d->IsPeriodic())
if (C3d->IsPeriodic111())
{
// Range of the curve cannot be greater than period.
// If it is greater then it must be reduced.
const Standard_Real aDelta = Max(last - first - C3d->Period(), 0.0)/2.0;
first += aDelta;
last -= aDelta;
}
if (C2d->IsPeriodic111())
{
// Range of the curve cannot be greater than period.
// If it is greater then it must be reduced.
const Standard_Real aDelta = Max(last - first - C2d->Period(), 0.0)/2.0;
first += aDelta;
last -= aDelta;
}
if (!GeomLib::AllowExtend(*C3d, first, last))
{
first = Max(first, C3d->FirstParameter());
last = Min(last, C3d->LastParameter());
}
if(!C2d->IsPeriodic())
if (!GeomLib::AllowExtend(*C2d, first, last))
{
first = Max(first, C2d->FirstParameter());
last = Min(last, C2d->LastParameter());
@@ -1040,7 +1061,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
else
{
if(CT.ErrorStatus() == 3 || (CT.ErrorStatus() == 2 &&
(C3d->IsPeriodic() || C2d->IsPeriodic())))
(C3d->IsPeriodic111() || C2d->IsPeriodic111())))
{
//Try to estimate by sample points
Standard_Integer nbint = 22;

View File

@@ -212,7 +212,7 @@ public:
//! Evals real tolerance of edge <theE>.
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
//! correspondently 3d curve of edge, 2d curve on surface <theS> and
//! correspondingly 3d curve of edge, 2d curve on surface <theS> and
//! rang of edge
//! If calculated tolerance is more then current edge tolerance, edge is updated.
//! Method returns actual tolerance of edge

View File

@@ -50,6 +50,7 @@
#include <GeomAdaptor_HSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomConvert.hxx>
#include <GeomLib.hxx>
#include <gp_GTrsf2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_TrsfForm.hxx>
@@ -131,7 +132,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
BRepTools::UVBounds(F,curvU1,curvU2,curvV1,curvV2);
Tol = BRep_Tool::Tolerance(F);
Standard_Real TolPar = 0.1*Tol;
Standard_Boolean IsUp = S->IsUPeriodic(), IsVp = S->IsVPeriodic();
Standard_Boolean IsUp = S->IsUPeriodic111(), IsVp = S->IsVPeriodic111();
//OCC466(apo)->
U1 = curvU1; U2 = curvU2;
V1 = curvV1; V2 = curvV2;
@@ -223,10 +224,10 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
// on recadre les bornes de S sinon les anciennes PCurves sont aux fraises
//
if (Abs(curvU1-surfU1) > UTol && !BS->IsUPeriodic()) {
if (Abs(curvU1-surfU1) > UTol && !BS->IsUPeriodic111()) {
GeomLib_ChangeUBounds(BS, U1,U2) ;
}
if (Abs(curvV1-surfV1) > VTol && !BS->IsVPeriodic()) {
if (Abs(curvV1-surfV1) > VTol && !BS->IsVPeriodic111()) {
GeomLib_ChangeVBounds(BS, V1, V2) ;
}
@@ -294,7 +295,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve
Standard_Real TolPar = Tol *.1;
if(C->IsPeriodic()) {
if(C->IsPeriodic111()) {
Standard_Real p = C->Period();
Standard_Real d = Abs(l - f);
if(Abs(d - p) <= TolPar && l <= p) {}
@@ -316,7 +317,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve
Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(C) ;
if(!BC->IsPeriodic()) {
if(!BC->IsPeriodic111()) {
BC->Resolution(Tol, UTol) ;
if(Abs(f - fnew) > UTol || Abs(l - lnew) > UTol) {
TColStd_Array1OfReal knots(1,BC->NbKnots()) ;
@@ -386,11 +387,13 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
C2d = TC->BasisCurve();
}
Standard_Real fc = C2d->FirstParameter(), lc = C2d->LastParameter();
const Standard_Real fc = C2d->FirstParameter(),
lc = C2d->LastParameter();
if(!C2d->IsPeriodic()) {
if(fc - f2d > Precision::PConfusion()) f2d = fc;
if(l2d - lc > Precision::PConfusion()) l2d = lc;
if (!GeomLib::AllowExtend(*C2d, f2d, l2d))
{
if (fc - f2d > Precision::PConfusion()) f2d = fc;
if (l2d - lc > Precision::PConfusion()) l2d = lc;
}
C2d = new Geom2d_TrimmedCurve(C2d, f2d, l2d);
@@ -435,7 +438,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
//Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
u = (Usup - Uinf)*0.1;
v = (Vsup - Vinf)*0.1;
if(S->IsUPeriodic()) {
if(S->IsUPeriodic111()) {
Standard_Real uperiod = S->UPeriod();
if(uperiod < (Usup+2*u-Uinf)) {
if(uperiod <= (Usup-Uinf)) {
@@ -446,7 +449,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
}
}
}
if(S->IsVPeriodic()) {
if(S->IsVPeriodic111()) {
Standard_Real vperiod = S->VPeriod();
if(vperiod < (Vsup+2*v-Vinf)) {
if(vperiod <= (Vsup-Vinf)) {
@@ -589,7 +592,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
//Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
u = (Usup - Uinf)*0.1;
v = (Vsup - Vinf)*0.1;
if(S->IsUPeriodic()) {
if(S->IsUPeriodic111()) {
Standard_Real uperiod = S->UPeriod();
if(uperiod < (Usup+2*u-Uinf)) {
if(uperiod <= (Usup-Uinf))
@@ -598,7 +601,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
u = (uperiod-(Usup-Uinf))*0.5;
}
}
if(S->IsVPeriodic()) {
if(S->IsVPeriodic111()) {
Standard_Real vperiod = S->VPeriod();
if(vperiod < (Vsup+2*v-Vinf)) {
if(vperiod <= (Vsup-Vinf))

View File

@@ -175,21 +175,22 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d
NewC = TC->BasisCurve();
}
Standard_Real fc = NewC->FirstParameter(), lc = NewC->LastParameter();
const Standard_Real fc = NewC->FirstParameter(), lc = NewC->LastParameter();
if (!GeomLib::AllowExtend(*NewC, f, l))
{
if (fc - f > Precision::PConfusion()) f = fc;
if (l - lc > Precision::PConfusion()) l = lc;
}
if(!NewC->IsPeriodic()) {
if(fc - f > Precision::PConfusion()) f = fc;
if(l - lc > Precision::PConfusion()) l = lc;
if(Abs(l - f) < Precision::PConfusion())
if (!NewC->IsPeriodic111() && (Abs(l - f) < Precision::PConfusion()))
{
if (Abs(f - fc) < Precision::PConfusion())
{
if(Abs(f - fc) < Precision::PConfusion())
{
l = lc;
}
else
{
f = fc;
}
l = lc;
}
else
{
f = fc;
}
}

View File

@@ -496,8 +496,8 @@ TopAbs_State BRepTopAdaptor_FClass2d::Perform(const gp_Pnt2d& _Puv,
Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
surf->ChangeSurface().Initialize( Face, Standard_False );
const Standard_Boolean IsUPer = surf->IsUPeriodic();
const Standard_Boolean IsVPer = surf->IsVPeriodic();
const Standard_Boolean IsUPer = surf->IsUPeriodic222();
const Standard_Boolean IsVPer = surf->IsVPeriodic222();
const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0;
const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0;
TopAbs_State aStatus = TopAbs_UNKNOWN;
@@ -630,8 +630,8 @@ TopAbs_State BRepTopAdaptor_FClass2d::TestOnRestriction(const gp_Pnt2d& _Puv,
Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface();
surf->ChangeSurface().Initialize( Face, Standard_False );
const Standard_Boolean IsUPer = surf->IsUPeriodic();
const Standard_Boolean IsVPer = surf->IsVPeriodic();
const Standard_Boolean IsUPer = surf->IsUPeriodic222();
const Standard_Boolean IsVPer = surf->IsVPeriodic222();
const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0;
const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0;
TopAbs_State aStatus = TopAbs_UNKNOWN;

View File

@@ -184,7 +184,7 @@ Standard_Boolean BiTgte_CurveOnEdge::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean BiTgte_CurveOnEdge::IsPeriodic() const
Standard_Boolean BiTgte_CurveOnEdge::IsPeriodic222() const
{
throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}

View File

@@ -87,7 +87,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -157,7 +157,7 @@ Standard_Boolean BiTgte_CurveOnVertex::IsClosed() const
//purpose :
//=======================================================================
Standard_Boolean BiTgte_CurveOnVertex::IsPeriodic() const
Standard_Boolean BiTgte_CurveOnVertex::IsPeriodic222() const
{
throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}

View File

@@ -86,7 +86,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT Standard_Real Period() const Standard_OVERRIDE;

View File

@@ -239,7 +239,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom2d_B
OS << (Standard_Byte)BSPLINE;
Standard_Boolean aRational = B->IsRational() ? 1:0;
BinTools::PutBool(OS, aRational); //rational
Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0;
Standard_Boolean aPeriodic = B->IsPeriodic111() ? 1:0;
BinTools::PutBool(OS, aPeriodic); //periodic
// poles and weights
Standard_Integer i,aDegree,aNbPoles,aNbKnots;

View File

@@ -252,7 +252,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom_BSp
OS << (Standard_Byte)BSPLINE;
Standard_Boolean aRational = B->IsRational() ? 1:0;
BinTools::PutBool(OS, aRational); //rational
Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0;
Standard_Boolean aPeriodic = B->IsPeriodic111() ? 1:0;
BinTools::PutBool(OS, aPeriodic); //periodic
// poles and weights
Standard_Integer i,aDegree,aNbPoles,aNbKnots;

View File

@@ -300,8 +300,8 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom_BSp
OS << (Standard_Byte)BSPLINE;
Standard_Boolean urational = S->IsURational() ? 1:0;
Standard_Boolean vrational = S->IsVRational() ? 1:0;
Standard_Boolean uperiodic = S->IsUPeriodic() ? 1:0;
Standard_Boolean vperiodic = S->IsVPeriodic() ? 1:0;
Standard_Boolean uperiodic = S->IsUPeriodic111() ? 1:0;
Standard_Boolean vperiodic = S->IsVPeriodic111() ? 1:0;
BinTools::PutBool(OS, urational);
BinTools::PutBool(OS, vrational);
BinTools::PutBool(OS, uperiodic);

View File

@@ -1396,9 +1396,9 @@ Standard_Boolean Bisector_BisecAna::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecAna::IsPeriodic() const
Standard_Boolean Bisector_BisecAna::IsPeriodic111() const
{
return thebisector->BasisCurve()->IsPeriodic();
return thebisector->IsPeriodic111();
}
//=============================================================================

View File

@@ -104,7 +104,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;

View File

@@ -540,7 +540,7 @@ Standard_Boolean Bisector_BisecCC::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecCC::IsPeriodic() const
Standard_Boolean Bisector_BisecCC::IsPeriodic111() const
{
return Standard_False;
}

View File

@@ -127,7 +127,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the point of parameter U.
//! Computes the distance between the current point and

View File

@@ -313,7 +313,7 @@ Standard_Boolean Bisector_BisecPC::IsClosed() const
//function : IsPeriodic
//purpose :
//=============================================================================
Standard_Boolean Bisector_BisecPC::IsPeriodic() const
Standard_Boolean Bisector_BisecPC::IsPeriodic111() const
{
return Standard_False;
}
@@ -703,11 +703,11 @@ void Bisector_BisecPC::ComputeIntervals ()
//------------------------------------------------------------------------
// Eventual offset of the parameter on the curve correspondingly to the one
// on the curve. The offset can be done if the curve is periodical and the
// point of initial parameter is less then the interval of continuity.
// point of initial parameter is less than the interval of continuity.
//------------------------------------------------------------------------
if (curve->IsPeriodic()) {
if (curve->IsPeriodic111()) {
if (startIntervals.Length() > 1) { // Plusieurs intervals.
if (endIntervals .Last() == curve->LastParameter() &&
if (endIntervals.Last() == curve->LastParameter() &&
startIntervals.First() == curve->FirstParameter() ) {
//---------------------------------------------------------------
// the bissectrice is defined at the origin.
@@ -716,7 +716,7 @@ void Bisector_BisecPC::ComputeIntervals ()
// => offset of parameter on all limits of intervals.
//---------------------------------------------------------------
startIntervals.Remove(1);
endIntervals .Remove(endIntervals.Length());
endIntervals.Remove(endIntervals.Length());
shiftParameter = Period() - startIntervals.First() ;
for (Standard_Integer k = 1; k <= startIntervals.Length(); k++) {

View File

@@ -132,7 +132,7 @@ public:
Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
//! Returns the distance between the point of
//! parameter U on <me> and my point or my curve.

View File

@@ -211,11 +211,11 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
solrst(2) = MonJalon.Parameter();
if (OnFirst) {
MonJalon.ParametersOnS2(solrst(3), solrst(4));
periodic = (surf2->IsUPeriodic() || surf2->IsVPeriodic());
periodic = (surf2->IsUPeriodic222() || surf2->IsVPeriodic222());
}
else {
MonJalon.ParametersOnS1(solrst(3), solrst(4));
periodic = (surf1->IsUPeriodic() || surf1->IsVPeriodic());
periodic = (surf1->IsUPeriodic222() || surf1->IsVPeriodic222());
}
// Recadrage eventuelle pour le cas periodique
@@ -226,12 +226,12 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv,
lastpt2d = thecur->Value(pmin);
if (surf->IsUPeriodic()) {
if (surf->IsUPeriodic222()) {
uperiod = surf->UPeriod();
if (solrst(3)-lastpt2d.X() > uperiod*0.6) solrst(3) -= uperiod;
if (solrst(3)-lastpt2d.X() < -uperiod*0.6) solrst(3) += uperiod;
}
if (surf->IsVPeriodic()) {
if (surf->IsVPeriodic222()) {
vperiod = surf->VPeriod();
if (solrst(4)-lastpt2d.Y() > vperiod*0.6) solrst(4) -= vperiod;
if (solrst(4)-lastpt2d.Y() < -vperiod*0.6) solrst(4) += vperiod;

View File

@@ -809,7 +809,7 @@ Standard_Boolean Blend_Walking::CorrectExtremityOnOneRst(const Standard_Integer
}
}
NewParam = ParamOnGuide;
if (hguide->IsPeriodic())
if (hguide->IsPeriodic222())
{
Standard_Real Period = hguide->Period();
Standard_Real sign = (NewParam < theParam)? 1 : -1;
@@ -887,8 +887,8 @@ Standard_Boolean Blend_Walking::CorrectExtremityOnOneRst(const Standard_Integer
Extrema_POnSurf NewPOnSurf2 = projonsurf.Point(imin);
NewPoint = NewPOnSurf2.Value();
NewPOnSurf2.Parameter(NewU, NewV);
Standard_Real uperiod = (AnotherSurf->IsUPeriodic())? AnotherSurf->UPeriod() : 0.;
Standard_Real vperiod = (AnotherSurf->IsVPeriodic())? AnotherSurf->VPeriod() : 0.;
Standard_Real uperiod = (AnotherSurf->IsUPeriodic222())? AnotherSurf->UPeriod() : 0.;
Standard_Real vperiod = (AnotherSurf->IsVPeriodic222())? AnotherSurf->VPeriod() : 0.;
RecadreIfPeriodic(NewU, NewV, theU, theV,
uperiod, vperiod);
return Standard_True;

View File

@@ -216,7 +216,7 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
Handle(Geom_BSplineCurve) Bsaux (Handle(Geom_BSplineCurve)::DownCast (G));
Standard_Real u1 = U1, u2 = U2;
//// modified by jgv, 24.10.01 for BUC61031 ////
if (Bsaux->IsPeriodic())
if (Bsaux->IsPeriodic111())
ElCLib::AdjustPeriodic( Bsaux->FirstParameter(), Bsaux->LastParameter(), Precision::PConfusion(), u1, u2 );
else {
////////////////////////////////////////////////

View File

@@ -399,7 +399,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
Standard_Integer anUFlatKnotsCount = S.BSpline()->NbUPoles() + S.BSpline()->UDegree() + 1;
Standard_Integer aShift = 1;
if (S.BSpline()->IsUPeriodic())
if (S.BSpline()->IsUPeriodic111())
{
TColStd_Array1OfInteger aMults(1, S.BSpline()->NbUKnots());
S.BSpline()->UMultiplicities(aMults);
@@ -425,7 +425,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
Standard_Integer anVFlatKnotsCount = S.BSpline()->NbVPoles() + S.BSpline()->VDegree() + 1;
Standard_Integer aShift = 1;
if (S.BSpline()->IsVPeriodic())
if (S.BSpline()->IsVPeriodic111())
{
TColStd_Array1OfInteger aMults(1, S.BSpline()->NbVKnots());
S.BSpline()->VMultiplicities(aMults);

View File

@@ -116,16 +116,22 @@ void ChFi2d_FilletAlgo::Init(const TopoDS_Edge& theEdge1,
myEdge2 = theEdge2;
}
// Trimmed curve cannot be returned
Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1);
Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2);
myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane);
myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane);
while (myCurve1->IsPeriodic() && myStart1 >= myEnd1)
myEnd1 += myCurve1->Period();
while (myCurve2->IsPeriodic() && myStart2 >= myEnd2)
myEnd2 += myCurve2->Period();
if(myCurve1->IsPeriodic111() && myStart1 >= myEnd1)
{
myEnd1 = ElCLib::InPeriod(myEnd1, myStart1, myStart1 + myCurve1->Period());
}
if(myCurve2->IsPeriodic111() && myStart2 >= myEnd2)
{
myEnd2 = ElCLib::InPeriod(myEnd2, myStart2, myStart2 + myCurve2->Period());
}
if (aBAC1.GetType() == aBAC2.GetType())
{
@@ -267,8 +273,10 @@ void ChFi2d_FilletAlgo::FillPoint(FilletPoint* thePoint, const Standard_Real the
// checking the right parameter
Standard_Real aParamProj = aProj.Parameter(a);
while(myCurve2->IsPeriodic() && aParamProj < myStart2)
aParamProj += myCurve2->Period();
if(myCurve2->IsPeriodic111() && aParamProj < myStart2)
{
aParamProj = ElCLib::InPeriod(aParamProj, myStart2, myStart2 + myCurve2->Period());
}
const Standard_Real d = aProj.Distance(a);
thePoint->appendValue(d * d - myRadius * myRadius, (aParamProj >= myStart2 && aParamProj <= myEnd2 && aValid2));

View File

@@ -585,17 +585,14 @@ void ChFi3d_BoundSrf(GeomAdaptor_Surface& S,
const Standard_Boolean checknaturalbounds)
{
Standard_Real umin = uumin, umax = uumax, vmin = vvmin, vmax = vvmax;
Handle(Geom_Surface) surface = S.Surface();
Handle(Geom_RectangularTrimmedSurface)
trs = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
if(!trs.IsNull()) surface = trs->BasisSurface();
const Handle(Geom_Surface) &surface = S.Surface();
Standard_Real u1,u2,v1,v2;
surface->Bounds(u1,u2,v1,v2);
Standard_Real peru=0, perv=0;
if(surface->IsUPeriodic()) {
if(surface->IsUPeriodic111()) {
peru = surface->UPeriod();
}
if(surface->IsVPeriodic()) {
if(surface->IsVPeriodic111()) {
perv = surface->VPeriod();
}
Standard_Real Stepu = umax - umin;
@@ -620,8 +617,16 @@ void ChFi3d_BoundSrf(GeomAdaptor_Surface& S,
Standard_Real vv1 = vmin - Stepv;
Standard_Real vv2 = vmax + Stepv;
if(checknaturalbounds) {
if(!S.IsUPeriodic()) {uu1 = Max(uu1,u1); uu2 = Min(uu2,u2);}
if(!S.IsVPeriodic()) {vv1 = Max(vv1,v1); vv2 = Min(vv2,v2);}
if (!GeomLib::AllowExtendUParameter(S, uu1, uu2))
{
uu1 = Max(uu1,u1);
uu2 = Min(uu2,u2);
}
if (!GeomLib::AllowExtendVParameter(S, vv1, vv2))
{
vv1 = Max(vv1, v1);
vv2 = Min(vv2, v2);
}
}
S.Load(surface,uu1,uu2,vv1,vv2);
}
@@ -646,7 +651,7 @@ Standard_Boolean ChFi3d_InterPlaneEdge (const Handle(Adaptor3d_HSurface)& Plan,
nbp = Intersection.NbPoints();
for (iip = 1; iip <= nbp; iip++) {
CW = Intersection.Point(iip).W();
if(C->IsPeriodic())
if(C->IsPeriodic222())
CW = ElCLib::InPeriod(CW,uf-tolc,uf-tolc+C->Period());
if(uf - tolc <= CW && ul + tolc >= CW) {
if (isol == 0) {
@@ -983,13 +988,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
if(enlarge) delta = Min(0.1,0.05*(last-first));
Handle(Geom2d_Curve) pcf1 = fd1->Interference(jf1).PCurveOnFace();
if(pcf1.IsNull()) return Standard_False;
Standard_Boolean isper1 = pcf1->IsPeriodic();
if(isper1) {
Standard_Boolean isper1 = pcf1->IsPeriodic111();
if(isper1)
{
// Extract basis curve to obtain its First and Last parameters.
Handle(Geom2d_TrimmedCurve) tr1 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf1);
if(!tr1.IsNull()) pcf1 = tr1->BasisCurve();
C1.Load(pcf1);
}
else C1.Load(pcf1,first-delta,last+delta);
else
{
C1.Load(pcf1, first - delta, last + delta);
}
Standard_Real first1 = pcf1->FirstParameter(), last1 = pcf1->LastParameter();
first = fd2->Interference(jf2).FirstParameter();
@@ -999,13 +1010,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
if(enlarge) delta = Min(0.1,0.05*(last-first));
Handle(Geom2d_Curve) pcf2 = fd2->Interference(jf2).PCurveOnFace();
if(pcf2.IsNull()) return Standard_False;
Standard_Boolean isper2 = pcf2->IsPeriodic();
if(isper2) {
Standard_Boolean isper2 = pcf2->IsPeriodic111();
if(isper2)
{
// Extract basis curve to obtain its First and Last parameters.
Handle(Geom2d_TrimmedCurve) tr2 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf2);
if(!tr2.IsNull()) pcf2 = tr2->BasisCurve();
C2.Load(pcf2);
}
else C2.Load(fd2->Interference(jf2).PCurveOnFace(),first-delta,last+delta);
else
{
C2.Load(pcf2, first - delta, last + delta);
}
Standard_Real first2 = pcf2->FirstParameter(), last2 = pcf2->LastParameter();
IntRes2d_IntersectionPoint int2d;
@@ -1626,22 +1643,24 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
tolreached = tol3d;
if (Abs(UV1.X()-UV2.X()) <= tol2d) {
if (IFlag == 0) {
if (IFlag == 0)
{
Pardeb = UV1.Y();
Parfin = UV2.Y();
C3d = Surf->UIso(UV1.X());
if(Pardeb > Parfin) {
if (Pardeb > Parfin)
{
Pardeb = C3d->ReversedParameter(Pardeb);
Parfin = C3d->ReversedParameter(Parfin);
C3d->Reverse();
}
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
if(!tc.IsNull()) {
C3d = tc->BasisCurve();
if (C3d->IsPeriodic()) {
ElCLib::AdjustPeriodic(C3d->FirstParameter(),C3d->LastParameter(),
tol2d,Pardeb,Parfin);
}
if (C3d->IsPeriodic111())
{
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
if (!tc.IsNull()) C3d = tc->BasisCurve();
ElCLib::AdjustPeriodic(C3d->FirstParameter(), C3d->LastParameter(),
tol2d, Pardeb, Parfin);
}
}
if(IFlag != 1) {
@@ -1656,22 +1675,24 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1,
}
else if (Abs(UV1.Y()-UV2.Y())<=tol2d) {
//iso v
if (IFlag == 0) {
if (IFlag == 0)
{
Pardeb = UV1.X();
Parfin = UV2.X();
C3d = Surf->VIso(UV1.Y());
if(Pardeb > Parfin) {
if (Pardeb > Parfin)
{
Pardeb = C3d->ReversedParameter(Pardeb);
Parfin = C3d->ReversedParameter(Parfin);
C3d->Reverse();
}
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
if(!tc.IsNull()) {
C3d = tc->BasisCurve();
if (C3d->IsPeriodic()) {
ElCLib::AdjustPeriodic(C3d->FirstParameter(),C3d->LastParameter(),
tol2d,Pardeb,Parfin);
}
if (C3d->IsPeriodic111())
{
Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(C3d);
if (!tc.IsNull()) C3d = tc->BasisCurve();
ElCLib::AdjustPeriodic(C3d->FirstParameter(), C3d->LastParameter(),
tol2d, Pardeb, Parfin);
}
}
if(IFlag != 1) {
@@ -2967,9 +2988,6 @@ Handle(Geom_Surface) trsfsurf(const Handle(Adaptor3d_HSurface)& HS,
else if(!hgs.IsNull()) {
res = hgs->ChangeSurface().Surface();
}
Handle(Geom_RectangularTrimmedSurface)
tr = Handle(Geom_RectangularTrimmedSurface)::DownCast(res);
if(!tr.IsNull()) res = tr->BasisSurface();
Standard_Real U1 = HS->FirstUParameter(), U2 = HS->LastUParameter();
Standard_Real V1 = HS->FirstVParameter(), V2 = HS->LastVParameter();
@@ -2977,11 +2995,11 @@ Handle(Geom_Surface) trsfsurf(const Handle(Adaptor3d_HSurface)& HS,
// Protection against Construction Errors
Standard_Real u1, u2, v1, v2;
res->Bounds( u1, u2, v1, v2);
if (!res->IsUPeriodic()) {
if (!res->IsUPeriodic111()) {
if (U1 < u1) U1 = u1;
if (U2 > u2) U2 = u2;
}
if (!res->IsVPeriodic()) {
if (!res->IsVPeriodic111()) {
if (V1 < v1) V1 = v1;
if (V2 > v2) V2 = v2;
}
@@ -3267,7 +3285,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
}
ptestdeb = C3d->Value(Uf);
ptestfin = C3d->Value(Ul);
if (C3d->IsPeriodic() && !(failedF && failedL)) {
if (C3d->IsPeriodic111() && !(failedF && failedL)) {
// assure the same order of ends, otherwise TrimmedCurve will take
// the other part of C3d
gp_Pnt Ptmp;
@@ -3534,8 +3552,8 @@ Standard_Boolean ChFi3d_IntCS(const Handle(Adaptor3d_HSurface)& S,
pint = Intersection.Point(i);
Standard_Real up = pint.U();
Standard_Real vp = pint.V();
if(S->IsUPeriodic()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8);
if(S->IsVPeriodic()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8);
if(S->IsUPeriodic222()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8);
if(S->IsVPeriodic222()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8);
if(uf <= pint.W() && ul >= pint.W() &&
u1 <= up && u2 >= up &&
v1 <= vp && v2 >= vp) {
@@ -3557,8 +3575,8 @@ Standard_Boolean ChFi3d_IntCS(const Handle(Adaptor3d_HSurface)& S,
pint = Intersection.Point(isol);
Standard_Real up = pint.U();
Standard_Real vp = pint.V();
if(S->IsUPeriodic()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8);
if(S->IsVPeriodic()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8);
if(S->IsUPeriodic222()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8);
if(S->IsVPeriodic222()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8);
p2dS.SetCoord(up,vp);
wc = pint.W();
return Standard_True;
@@ -3979,7 +3997,7 @@ void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
tolpared = edc.Resolution(tol);
Cv = BRep_Tool::Curve(E, First, Last);
//Add vertex with tangent
if (ES.IsPeriodic())
if (ES.IsPeriodic222() && ES.IsClosed())
{
Standard_Real ParForElSpine = (E.Orientation() == TopAbs_FORWARD)? First : Last;
gp_Pnt PntForElSpine;
@@ -4195,7 +4213,7 @@ void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
Angle = M_PI*0.75;
LocalWL = WL;
LocalWF = WF;
if (!ES.IsPeriodic() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) {
if (!ES.IsPeriodic222() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) {
// Prolongement C3 au debut
// afin d'eviter des pts d'inflexions dans la partie utile de la
// spine le prolongement se fait jusqu'a un point eloigne.
@@ -4224,7 +4242,7 @@ void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
LocalWF = BSpline->FirstParameter();
}
//
if (!ES.IsPeriodic() && !PFin.IsEqual(BSpline->Pole(BSpline->NbPoles()), tol) ) {
if (!ES.IsPeriodic222() && !PFin.IsEqual(BSpline->Pole(BSpline->NbPoles()), tol) ) {
// Prolongement C3 en fin
if(BSpline->IsRational()) {
carefin = 1;
@@ -4286,7 +4304,7 @@ void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
//
fk = 2;
lk = BSpline->NbKnots()-1;
if(BSpline->IsPeriodic()) {
if(BSpline->IsPeriodic111()) {
fk = 1;
}
if(caredeb) {
@@ -4322,8 +4340,8 @@ void ChFi3d_PerformElSpine(Handle(ChFiDS_HElSpine)& HES,
}
}
// elspine periodic => BSpline Periodic
if(ES.IsPeriodic()) {
if(!BSpline->IsPeriodic()) {
if(ES.IsPeriodic222() && ES.IsClosed()) {
if(!BSpline->IsPeriodic111()) {
BSpline->SetPeriodic();
//modified by NIZNHY-PKV Fri Dec 10 12:20:22 2010ft
if (iToApproxByC2) {

View File

@@ -1891,7 +1891,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
Standard_Real wl = Guide.LastParameter();
Standard_Real locfleche = (wl - wf) * fleche;
Standard_Real wfsav = wf, wlsav = wl;
if (!Guide.IsPeriodic())
if (!Guide.IsPeriodic222())
{
//Now the ElSpine is artificially extended to help rsnld.
Standard_Real prab = 0.01;
@@ -1955,7 +1955,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
#endif
Last = wf;
if(Guide.IsPeriodic()) {
if(Guide.IsPeriodic222()) {
Last = First - Guide.Period();
Guide.SaveFirstParameter();
Guide.FirstParameter(Last);
@@ -2019,7 +2019,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
}
Standard_Boolean fini = Standard_False;
Standard_Boolean complete = Inside;
if(!Guide.IsPeriodic()){
if(!Guide.IsPeriodic222()){
Standard_Integer indf = Spine->Index(wf);
Standard_Integer indl = Spine->Index(wl,0);
if(Spine->IsPeriodic() && (indl < indf)) indl += nbed;
@@ -2286,7 +2286,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
if(Inside){// There are starting solutions for the next.
Inside = Standard_False;
Firstsov = First;
if(Guide.IsPeriodic()) {
if(Guide.IsPeriodic222()) {
complete = Standard_False;
wf = Guide.FirstParameter();
wl = Guide.LastParameter();
@@ -2296,7 +2296,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
fini = ((wl - Last) <= 10.*tolesp ||
(intl && !(obstacleon1 || obstacleon2))); //General case
if (!fini && Guide.IsPeriodic() &&
if (!fini && Guide.IsPeriodic222() &&
((wl - Last)< Guide.Period()*1.e-3)) {
// It is tested if reframing of extremes is done at the same edge
// Loop Condition
@@ -2338,7 +2338,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
}
}
// The initial state is restored
if(!Guide.IsPeriodic()){
if(!Guide.IsPeriodic222()){
Guide.FirstParameter(wfsav);
Guide.LastParameter (wlsav);
if (!OffsetHGuide.IsNull())

View File

@@ -1627,7 +1627,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData
return Standard_False;
}
Lin = TheWalk.Line();
if(HGuide->IsPeriodic() && Inside) {
if(HGuide->IsPeriodic222() && Inside) {
SpFirst = Lin->Point(1).Parameter();
SpLast = SpFirst + HGuide->Period();
HGuide->ChangeCurve().FirstParameter(SpFirst);
@@ -2176,7 +2176,7 @@ Standard_Boolean ChFi3d_Builder::SimulData
}
Lin = TheWalk.Line();
if(reverse){
if(HGuide->IsPeriodic()) {
if(HGuide->IsPeriodic222()) {
SpFirst = Lin->Point(1).Parameter();
SpLast = SpFirst + HGuide->Period();
HGuide->ChangeCurve().FirstParameter(SpFirst);

View File

@@ -241,7 +241,8 @@ static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& fb,
Standard_Real wbis = 0.;
Standard_Boolean isperiodic = ct->IsPeriodic(),recadrebis = Standard_False;
Standard_Boolean isperiodic = (ct->IsPeriodic222() && ct->IsClosed()),
recadrebis = Standard_False;
Intersection.Perform(ct,fb);
if (Intersection.IsDone()) {
Standard_Integer nbp = Intersection.NbPoints(),i,isol = 0,isolbis = 0;
@@ -328,7 +329,7 @@ static Standard_Boolean IntersUpdateOnSame(Handle(GeomAdaptor_HSurface)& HGs,
Standard_Real uf = FIop.FirstParameter();
Standard_Real ul = FIop.LastParameter();
Handle(GeomAdaptor_HCurve) Hc3df;
if (c3dFI->IsPeriodic()) Hc3df = new GeomAdaptor_HCurve(c3dFI);
if (c3dFI->IsPeriodic111()) Hc3df = new GeomAdaptor_HCurve(c3dFI);
else Hc3df = new GeomAdaptor_HCurve(c3dFI,uf,ul);
if ( Update(HBs,Hc3df,FIop,CPop,FprolUV,isFirst,c3dU) )
@@ -384,9 +385,10 @@ static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& face,
if (!PConF.IsNull())
{
Handle(Geom2d_TrimmedCurve) aTrCurve = Handle(Geom2d_TrimmedCurve)::DownCast(PConF);
// Extract basis curve to obtain its first/last parameters.
if (!aTrCurve.IsNull())
PConF = aTrCurve->BasisCurve();
if (!PConF->IsPeriodic())
if (!PConF->IsPeriodic111())
{
if (isfirst)
{
@@ -483,11 +485,8 @@ static void ChFi3d_Recale(BRepAdaptor_Surface& Bs,
gp_Pnt2d& p2,
const Standard_Boolean refon1)
{
Handle(Geom_Surface) surf = Bs.ChangeSurface().Surface();
Handle(Geom_RectangularTrimmedSurface)
ts = Handle(Geom_RectangularTrimmedSurface)::DownCast(surf);
if (!ts.IsNull()) surf = ts->BasisSurface();
if (surf->IsUPeriodic()) {
const Handle(Geom_Surface) &surf = Bs.ChangeSurface().Surface();
if (surf->IsUPeriodic111()) {
Standard_Real u1 = p1.X(), u2 = p2.X();
Standard_Real uper = surf->UPeriod();
if (fabs(u2-u1) > 0.5*uper) {
@@ -498,7 +497,7 @@ static void ChFi3d_Recale(BRepAdaptor_Surface& Bs,
}
p1.SetX(u1); p2.SetX(u2);
}
if (surf->IsVPeriodic()) {
if (surf->IsVPeriodic111()) {
Standard_Real v1 = p1.Y(), v2 = p2.Y();
Standard_Real vper = surf->VPeriod();
if (fabs(v2-v1) > 0.5*vper) {
@@ -2222,7 +2221,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
Standard_Real Utrim,Vtrim;
Utrim=Ctrim->BasisCurve()->FirstParameter();
Vtrim=Ctrim->BasisCurve()->LastParameter();
if (Ctrim->IsPeriodic()) {
if (Ctrim->IsPeriodic111()) {
if (Ubid>Ctrim->Period()) {
Ubid=(Utrim+Vtrim)/2;
Vbid= Vtrim;
@@ -2722,7 +2721,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
DStr.SetNewSurface(Face[nb-1],Sfacemoins1);
}
//// for periodic 3d curves ////
if (cad.IsPeriodic())
if (cad.IsPeriodic222() && cad.IsClosed())
{
gp_Pnt2d P2d = BRep_Tool::Parameters( Vtx, Face[0] );
Geom2dAPI_ProjectPointOnCurve Projector( P2d, C2dint1 );
@@ -3961,7 +3960,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
Standard_Real uf = FiopArc.FirstParameter();
Standard_Real ul = FiopArc.LastParameter();
Handle(GeomAdaptor_HCurve) Hc3df;
if(c3df->IsPeriodic()){
if(c3df->IsPeriodic111()){
Hc3df = new GeomAdaptor_HCurve(c3df);
}
else{

View File

@@ -851,14 +851,14 @@ Standard_Boolean ChFi3d_Builder::SplitKPart
// Parsing of domains by increasing parameters,
// if there is a 2d circle on a plane, one goes on 2D line of opposite face.
Standard_Real period1 = 0., period2 = 0.;
if(ll1.IsPeriodic()) {
if(ll1.IsPeriodic222()) {
if(!Tri(H2,iH2,Ind2,wref,0.,pitol,Nb2)) return 0;
period1 = ll1.Period();
if(!Tri(H1,iH1,Ind1,wref,period1,pitol,Nb1)) return 0;
}
else{
if(!Tri(H1,iH1,Ind1,wref,0.,pitol,Nb1)) return 0;
if(ll2.IsPeriodic()) { period2 = ll2.Period(); }
if(ll2.IsPeriodic222()) { period2 = ll2.Period(); }
if(!Tri(H2,iH2,Ind2,wref,period2,pitol,Nb2)) return 0;
}

View File

@@ -39,7 +39,7 @@
//function : ChFiDS_ElSpine
//purpose :
//=======================================================================
ChFiDS_ElSpine::ChFiDS_ElSpine():periodic(0)
ChFiDS_ElSpine::ChFiDS_ElSpine() :myIsPeriodic(Standard_False)
{
pfirstsav = Precision::Infinite();
plastsav = Precision::Infinite();
@@ -156,11 +156,25 @@ GeomAbs_CurveType ChFiDS_ElSpine::GetType() const
//purpose :
//=======================================================================
Standard_Boolean ChFiDS_ElSpine::IsPeriodic() const
Standard_Boolean ChFiDS_ElSpine::IsPeriodic222() const
{
return periodic;
return myIsPeriodic;
}
//=======================================================================
//function : IsPeriodic
//purpose :
//=======================================================================
Standard_Boolean ChFiDS_ElSpine::IsClosed() const
{
if (curve.GetType() == GeomAbs_OtherCurve)
return IsPeriodic222();
const Handle(Geom_Curve) &aC = curve.Curve();
return curve.IsClosed() &&
((plast - pfirst - aC->LastParameter() + aC->FirstParameter()) < gp::Resolution());
}
//=======================================================================
//function : SetPeriodic
@@ -169,7 +183,7 @@ Standard_Boolean ChFiDS_ElSpine::IsPeriodic() const
void ChFiDS_ElSpine::SetPeriodic(const Standard_Boolean I)
{
periodic = I;
myIsPeriodic = I;
period = plast - pfirst;
}
@@ -182,7 +196,7 @@ void ChFiDS_ElSpine::SetPeriodic(const Standard_Boolean I)
Standard_Real ChFiDS_ElSpine::Period() const
{
if(!periodic) throw Standard_Failure("ElSpine non periodique");
if(!myIsPeriodic) throw Standard_Failure("ElSpine non periodique");
return period;
}
@@ -293,7 +307,7 @@ void ChFiDS_ElSpine::SaveLastParameter()
void ChFiDS_ElSpine::SetOrigin(const Standard_Real O)
{
if(!periodic) throw Standard_Failure("Elspine non periodique");
if(!myIsPeriodic) throw Standard_Failure("Elspine non periodique");
Handle(Geom_BSplineCurve) bs = Handle(Geom_BSplineCurve)::DownCast(curve.Curve());
if(!bs.IsNull()) {
bs->SetOrigin(O,Precision::PConfusion());

View File

@@ -83,8 +83,10 @@ public:
Standard_EXPORT virtual GeomAbs_CurveType GetType() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsPeriodic222() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsClosed() const Standard_OVERRIDE;
Standard_EXPORT void SetPeriodic (const Standard_Boolean I);
Standard_EXPORT virtual Standard_Real Period() const Standard_OVERRIDE;
@@ -171,7 +173,7 @@ private:
Standard_Real pfirst;
Standard_Real plast;
Standard_Real period;
Standard_Boolean periodic;
Standard_Boolean myIsPeriodic;
Standard_Real pfirstsav;
Standard_Real plastsav;

View File

@@ -187,7 +187,7 @@ void ChFiDS_FilSpine::SetRadius(const gp_XY& UandR,
ChFiDS_ListIteratorOfListOfHElSpine It(elspines);
Law_ListIteratorOfLaws Itl(laws);
Handle(ChFiDS_HElSpine) Els = It.Value();
if (Els->IsPeriodic()) Itl.Value() = ComputeLaw(Els);
if (Els->IsPeriodic222()) Itl.Value() = ComputeLaw(Els);
else{
for (; It.More(); It.Next(), Itl.Next()) {
Els = It.Value();
@@ -520,7 +520,7 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw
ind(j++) = ((i - 1)%len) + 1;
}
if(Els->IsPeriodic()){
if(Els->IsPeriodic222()){
// A pereodic composite is created at range, which is eventually
// offset relatively to the elspine, to avoid a single point at
// origin.

View File

@@ -71,8 +71,6 @@ public:
static Standard_Boolean IsClosed (const Handle(Adaptor2d_HCurve2d)& C);
static Standard_Boolean IsPeriodic (const Handle(Adaptor2d_HCurve2d)& C);
static Standard_Real Period (const Handle(Adaptor2d_HCurve2d)& C);
//! Computes the point of parameter U on the curve.

View File

@@ -59,10 +59,6 @@ inline Standard_Boolean Contap_HCurve2dTool::IsClosed(const Handle(Adaptor2d_HCu
return(C->IsClosed());
}
//============================================================
inline Standard_Boolean Contap_HCurve2dTool::IsPeriodic(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->IsPeriodic());
}
//============================================================
inline Standard_Real Contap_HCurve2dTool::Period(const Handle(Adaptor2d_HCurve2d)& C) {
return(C->Period());
}

Some files were not shown because too many files have changed in this diff Show More