1 // Created on: 1997-02-10
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Adaptor2d_HCurve2d.hxx>
19 #include <Adaptor3d_HCurve.hxx>
20 #include <Adaptor3d_HSurface.hxx>
21 #include <Blend_Point.hxx>
22 #include <BlendFunc.hxx>
23 #include <BRepBlend_RstRstConstRad.hxx>
25 #include <GeomFill.hxx>
27 #include <gp_Circ.hxx>
29 #include <gp_Pnt2d.hxx>
31 #include <gp_Vec2d.hxx>
32 #include <math_Gauss.hxx>
33 #include <math_Matrix.hxx>
34 #include <math_SVD.hxx>
35 #include <Precision.hxx>
36 #include <Standard_DomainError.hxx>
37 #include <Standard_NotImplemented.hxx>
41 static void t3dto2d(Standard_Real& a,
47 Standard_Real AB = A.Dot(B);
48 Standard_Real AC = A.Dot(C);
49 Standard_Real BC = B.Dot(C);
50 Standard_Real BB = B.Dot(B);
51 Standard_Real CC = C.Dot(C);
52 Standard_Real deno = (BB*CC-BC*BC);
53 a = (AB*CC-AC*BC)/deno;
54 b = (AC*BB-AB*BC)/deno;
57 //=======================================================================
58 //function : BRepBlend_RstRstConstRad
60 //=======================================================================
62 BRepBlend_RstRstConstRad::BRepBlend_RstRstConstRad
63 (const Handle(Adaptor3d_HSurface)& Surf1,
64 const Handle(Adaptor2d_HCurve2d)& Rst1,
65 const Handle(Adaptor3d_HSurface)& Surf2,
66 const Handle(Adaptor2d_HCurve2d)& Rst2,
67 const Handle(Adaptor3d_HCurve)& CGuide):
68 surf1(Surf1), surf2(Surf2), rst1(Rst1), rst2(Rst2),
69 cons1(Rst1, Surf1), cons2(Rst2, Surf2),
70 guide(CGuide), tguide(CGuide),
71 istangent(Standard_True), maxang(RealFirst()), minang(RealLast()),
73 mySShape(BlendFunc_Rational)
76 //=======================================================================
77 //function : NbVariables
79 //=======================================================================
81 Standard_Integer BRepBlend_RstRstConstRad::NbVariables() const
86 //=======================================================================
87 //function : NbEquations
89 //=======================================================================
91 Standard_Integer BRepBlend_RstRstConstRad::NbEquations() const
96 //=======================================================================
99 //=======================================================================
101 Standard_Boolean BRepBlend_RstRstConstRad::Value(const math_Vector& X,
104 ptrst1 = cons1.Value(X(1));
105 ptrst2 = cons2.Value(X(2));
107 F(1) = nplan.XYZ().Dot(ptrst1.XYZ()) + theD;
108 F(2) = nplan.XYZ().Dot(ptrst2.XYZ()) + theD;
110 return Standard_True;
113 //=======================================================================
114 //function : Derivatives
116 //=======================================================================
118 Standard_Boolean BRepBlend_RstRstConstRad::Derivatives(const math_Vector& X,
123 cons1.D1(X(1), ptrst1, d11);
124 cons2.D1(X(2), ptrst2, d21);
126 D(1,1) = nplan.Dot(d11);
130 D(2,2) = nplan.Dot(d21);
132 return Standard_True;
135 //=======================================================================
138 //=======================================================================
140 Standard_Boolean BRepBlend_RstRstConstRad::Values(const math_Vector& X,
147 return Standard_True;
150 //=======================================================================
153 //=======================================================================
155 void BRepBlend_RstRstConstRad::Set(const Handle(Adaptor3d_HSurface)& SurfRef1,
156 const Handle(Adaptor2d_HCurve2d)& RstRef1,
157 const Handle(Adaptor3d_HSurface)& SurfRef2,
158 const Handle(Adaptor2d_HCurve2d)& RstRef2)
166 //=======================================================================
169 //=======================================================================
171 void BRepBlend_RstRstConstRad::Set(const Standard_Real Param)
173 tguide->D2(Param, ptgui, d1gui, d2gui);
174 normtg = d1gui.Magnitude();
175 nplan = d1gui.Normalized();
176 theD = - (nplan.XYZ().Dot(ptgui.XYZ()));
179 //=======================================================================
182 //=======================================================================
184 void BRepBlend_RstRstConstRad::Set(const Standard_Real First,
185 const Standard_Real Last)
187 tguide = guide->Trim(First, Last, 1.e-12);
190 //=======================================================================
191 //function : GetTolerance
193 //=======================================================================
195 void BRepBlend_RstRstConstRad::GetTolerance(math_Vector& Tolerance,
196 const Standard_Real Tol) const
198 Tolerance(1) = cons1.Resolution(Tol);
199 Tolerance(2) = cons2.Resolution(Tol);
202 //=======================================================================
203 //function : GetBounds
205 //=======================================================================
207 void BRepBlend_RstRstConstRad::GetBounds(math_Vector& InfBound,
208 math_Vector& SupBound) const
210 InfBound(1) = cons1.FirstParameter();
211 InfBound(2) = cons2.FirstParameter();
212 SupBound(1) = cons1.LastParameter();
213 SupBound(2) = cons2.LastParameter();
217 //=======================================================================
218 //function : IsSolution
220 //=======================================================================
222 Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol,
223 const Standard_Real Tol)
227 math_Vector valsol(1, 2), secmember(1, 2);
228 math_Matrix gradsol(1, 2, 1, 2);
230 gp_Vec dnplan, d1urst1, d1vrst1, d1urst2, d1vrst2, d11, d21, temp;
233 Standard_Real Cosa, Sina, Angle;
235 Values(Sol, valsol, gradsol);
237 if (Abs(valsol(1)) <= Tol &&
238 Abs(valsol(2)) <= Tol ) {
240 // Calculation of tangents
242 pt2drst1 = rst1->Value(prmrst1);
244 pt2drst2 = rst2->Value(prmrst2);
246 cons1.D1(Sol(1), ptrst1, d11);
247 cons2.D1(Sol(2), ptrst2, d21);
249 dnplan.SetLinearForm(1./normtg, d2gui,
250 -1./normtg * (nplan.Dot(d2gui)), nplan);
252 temp.SetXYZ(ptrst1.XYZ() - ptgui.XYZ());
253 secmember(1) = normtg - dnplan.Dot(temp);
255 temp.SetXYZ(ptrst2.XYZ() - ptgui.XYZ());
256 secmember(2) = normtg - dnplan.Dot(temp);
258 math_Gauss Resol(gradsol);
260 if (Resol.IsDone()) {
261 Resol.Solve(secmember);
262 istangent = Standard_False;
265 math_SVD SingRS (gradsol);
266 if (SingRS.IsDone()) {
267 math_Vector DEDT(1,3);
269 SingRS.Solve(DEDT, secmember, 1.e-6);
270 istangent = Standard_False;
272 else istangent = Standard_True;
277 tgrst1 = secmember(1) * d11;
278 tgrst2 = secmember(2) * d21;
281 surf1->D1(pt2drst1.X(), pt2drst1.Y(), bid, d1urst1, d1vrst1);
282 t3dto2d(a, b, tgrst1, d1urst1, d1vrst1);
283 tg2drst1.SetCoord(a, b);
284 surf2->D1(pt2drst2.X(), pt2drst2.Y(), bid, d1urst2, d1vrst2);
285 t3dto2d(a, b, tgrst1, d1urst2, d1vrst2);
286 tg2drst2.SetCoord(a, b);
291 Standard_Boolean IsCenter;
293 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
295 if (!IsCenter) return Standard_False;
297 gp_Vec n1(Center, ptrst1) , n2(Center, ptrst2);
303 Sina = nplan.Dot(n1.Crossed(n2));
306 Sina = -Sina; //nplan is changed into -nplan
311 Angle = 2.*M_PI - Angle;
314 if (Angle > maxang) {maxang = Angle;}
315 if (Angle < minang) {minang = Angle;}
316 distmin = Min( distmin, ptrst1.Distance(ptrst2));
318 return Standard_True;
320 istangent = Standard_True;
321 return Standard_False;
324 //=======================================================================
325 //function : GetMinimalDistance
327 //=======================================================================
329 Standard_Real BRepBlend_RstRstConstRad::GetMinimalDistance() const
334 //=======================================================================
335 //function : PointOnRst1
337 //=======================================================================
339 const gp_Pnt& BRepBlend_RstRstConstRad::PointOnRst1() const
344 //=======================================================================
345 //function : PointOnRst2
347 //=======================================================================
349 const gp_Pnt& BRepBlend_RstRstConstRad::PointOnRst2() const
354 //=======================================================================
355 //function : Pnt2dOnRst1
357 //=======================================================================
359 const gp_Pnt2d& BRepBlend_RstRstConstRad::Pnt2dOnRst1() const
364 //=======================================================================
365 //function : Pnt2dOnRst2
367 //=======================================================================
369 const gp_Pnt2d& BRepBlend_RstRstConstRad::Pnt2dOnRst2() const
374 //=======================================================================
375 //function : ParameterOnRst1
377 //=======================================================================
379 Standard_Real BRepBlend_RstRstConstRad::ParameterOnRst1() const
384 //=======================================================================
385 //function : ParameterOnRst2
387 //=======================================================================
389 Standard_Real BRepBlend_RstRstConstRad::ParameterOnRst2() const
393 //=======================================================================
394 //function : IsTangencyPoint
396 //=======================================================================
398 Standard_Boolean BRepBlend_RstRstConstRad::IsTangencyPoint() const
403 //=======================================================================
404 //function : TangentOnRst1
406 //=======================================================================
408 const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst1() const
410 if (istangent) {throw Standard_DomainError();}
414 //=======================================================================
415 //function : Tangent2dOnRst1
417 //=======================================================================
419 const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst1() const
421 if (istangent) {throw Standard_DomainError();}
425 //=======================================================================
426 //function : TangentOnRst2
428 //=======================================================================
430 const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst2() const
432 if (istangent) {throw Standard_DomainError();}
436 //=======================================================================
437 //function : Tangent2dOnRst2
439 //=======================================================================
441 const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst2() const
443 if (istangent) {throw Standard_DomainError();}
447 //=======================================================================
450 //=======================================================================
452 Blend_DecrochStatus BRepBlend_RstRstConstRad::Decroch(const math_Vector& Sol,
458 gp_Vec NRst1InPlane, NRst2InPlane;
459 gp_Pnt PtTmp1, PtTmp2, Center;
460 gp_Vec d1u, d1v, centptrst, NotUsed;
461 Standard_Real norm, unsurnorm;
464 rstref1->Value(Sol(1)).Coord(u, v);
465 surfref1->D1(u, v,PtTmp1,d1u,d1v);
466 // Normal to the reference surface 1
467 NRst1 = d1u.Crossed(d1v);
468 rstref2->Value(Sol(2)).Coord(u, v);
469 surfref2->D1(u, v, PtTmp2, d1u, d1v);
470 // Normal to the reference surface 2
471 NRst2 = d1u.Crossed(d1v);
473 CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
475 norm = nplan.Crossed(NRst1).Magnitude();
476 unsurnorm = 1. / norm;
478 NRst1InPlane.SetLinearForm(nplan.Dot(NRst1) * unsurnorm, nplan, -unsurnorm, NRst1);
480 centptrst.SetXYZ(PtTmp1.XYZ() - Center.XYZ());
482 if (centptrst.Dot(NRst1InPlane) < 0.) NRst1InPlane.Reverse();
484 TgRst1 = nplan.Crossed(centptrst);
486 norm = nplan.Crossed(NRst2).Magnitude();
487 unsurnorm = 1./ norm;
488 NRst2InPlane.SetLinearForm(nplan.Dot(NRst2) * unsurnorm, nplan, -unsurnorm, NRst2);
489 centptrst.SetXYZ(PtTmp2.XYZ() - Center.XYZ());
492 if (centptrst.Dot(NRst2InPlane) < 0.) NRst2InPlane.Reverse();
494 TgRst2 = nplan.Crossed(centptrst);
501 // The vectors are returned
502 if (NRst1InPlane.Dot(TgRst1) > -1.e-10) {
503 if (NRst2InPlane.Dot(TgRst2) < 1.e-10) {
504 return Blend_DecrochBoth;
507 return Blend_DecrochRst1;
511 if (NRst2InPlane.Dot(TgRst2) < 1.e-10) {
512 return Blend_DecrochRst2;
515 return Blend_NoDecroch;
521 //=======================================================================
524 //=======================================================================
526 void BRepBlend_RstRstConstRad::Set(const Standard_Real Radius,
527 const Standard_Integer Choix)
534 //=======================================================================
537 //=======================================================================
539 void BRepBlend_RstRstConstRad::Set(const BlendFunc_SectionShape TypeSection)
541 mySShape = TypeSection;
546 //=======================================================================
547 //function : CenterCircleRst1Rst2
548 //purpose : Calculate the center of the circle passing by two points of restrictions
549 //=======================================================================
550 Standard_Boolean BRepBlend_RstRstConstRad::CenterCircleRst1Rst2(const gp_Pnt& PtRst1,
551 const gp_Pnt& PtRst2,
557 gp_Vec rst1rst2(PtRst1, PtRst2);
558 gp_Vec vdmedNor; //,NRst1; vdmedNor directong vector of the perpendicular bisector
560 Standard_Real Dist;// distance between the middle of PtRst1,PtRst2 and Center
562 // Calculate the center of the circle
563 VdMed = rst1rst2.Crossed(np);
564 norm2 = rst1rst2.SquareMagnitude();
565 Dist = ray * ray - 0.25 * norm2;
571 if (Dist < - 1.E-07) return Standard_False;
575 vdmedNor = VdMed.Normalized();
576 Center.SetXYZ(0.5 * rst1rst2.XYZ() + PtRst1.XYZ() + Dist * vdmedNor.XYZ());
580 Center.SetXYZ(0.5 * rst1rst2.XYZ() + PtRst1.XYZ());
583 return Standard_True;
592 //=======================================================================
595 //=======================================================================
597 void BRepBlend_RstRstConstRad::Section(const Standard_Real Param,
598 const Standard_Real U,
599 const Standard_Real V,
604 gp_Vec ns, np, NotUsed;
607 tguide->D1(Param, ptgui, d1gui);
608 np = d1gui.Normalized();
609 ptrst1 = cons1.Value(U);
610 ptrst2 = cons2.Value(V);
612 CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
614 C.SetRadius(Abs(ray));
615 ns = gp_Vec(Center, ptrst1).Normalized();
621 C.SetPosition(gp_Ax2(Center, np, ns));
622 Pdeb = 0; //ElCLib::Parameter(C, pts);
623 Pfin = ElCLib::Parameter(C, ptrst2);
625 // Test of angles negative and almost null : Special Case
626 if (Pfin > 1.5 * M_PI) {
628 C.SetPosition(gp_Ax2(Center, np, ns));
629 Pfin = ElCLib::Parameter(C, ptrst2);
631 if (Pfin < Precision::PConfusion()) Pfin += Precision::PConfusion();
634 //=======================================================================
635 //function : IsRational
637 //=======================================================================
639 Standard_Boolean BRepBlend_RstRstConstRad::IsRational () const
641 return (mySShape==BlendFunc_Rational || mySShape==BlendFunc_QuasiAngular);
644 //=======================================================================
645 //function : GetSectionSize
647 //=======================================================================
649 Standard_Real BRepBlend_RstRstConstRad::GetSectionSize() const
651 return maxang * Abs(ray);
654 //=======================================================================
655 //function : GetMinimalWeight
657 //=======================================================================
659 void BRepBlend_RstRstConstRad::GetMinimalWeight(TColStd_Array1OfReal& Weights) const
661 BlendFunc::GetMinimalWeights(mySShape, myTConv, minang, maxang, Weights );
662 // It is supposed that it does not depend on the Radius!
665 //=======================================================================
666 //function : NbIntervals
668 //=======================================================================
670 Standard_Integer BRepBlend_RstRstConstRad::NbIntervals (const GeomAbs_Shape S) const
672 return guide->NbIntervals(BlendFunc::NextShape(S));
675 //=======================================================================
676 //function : Intervals
678 //=======================================================================
680 void BRepBlend_RstRstConstRad::Intervals (TColStd_Array1OfReal& T,
681 const GeomAbs_Shape S) const
683 guide->Intervals(T, BlendFunc::NextShape(S));
686 //=======================================================================
687 //function : GetShape
689 //=======================================================================
691 void BRepBlend_RstRstConstRad::GetShape (Standard_Integer& NbPoles,
692 Standard_Integer& NbKnots,
693 Standard_Integer& Degree,
694 Standard_Integer& NbPoles2d)
697 BlendFunc::GetShape(mySShape, maxang, NbPoles, NbKnots, Degree, myTConv);
700 //=======================================================================
701 //function : GetTolerance
702 //purpose : Determine Tolerances to be used in approximations.
703 //=======================================================================
705 void BRepBlend_RstRstConstRad::GetTolerance(const Standard_Real BoundTol,
706 const Standard_Real SurfTol,
707 const Standard_Real AngleTol,
709 math_Vector& Tol1d) const
711 Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper();
713 Tol= GeomFill::GetTolerance(myTConv, minang, Abs(ray),
717 Tol3d(low+1) = Tol3d(up-1) = Min(Tol, SurfTol);
718 Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol);
721 //=======================================================================
724 //=======================================================================
726 void BRepBlend_RstRstConstRad::Knots(TColStd_Array1OfReal& TKnots)
728 GeomFill::Knots(myTConv, TKnots);
731 //=======================================================================
734 //=======================================================================
736 void BRepBlend_RstRstConstRad::Mults(TColStd_Array1OfInteger& TMults)
738 GeomFill::Mults(myTConv, TMults);
741 //=======================================================================
744 //=======================================================================
746 void BRepBlend_RstRstConstRad::Section(const Blend_Point& P,
747 TColgp_Array1OfPnt& Poles,
748 TColgp_Array1OfPnt2d& Poles2d,
749 TColStd_Array1OfReal& Weights)
751 gp_Vec ns, ns2, NotUsed;
755 Standard_Real prm = P.Parameter();
756 Standard_Integer low = Poles.Lower();
757 Standard_Integer upp = Poles.Upper();
759 tguide->D1(prm,ptgui, d1gui);
760 nplan = d1gui.Normalized();
762 u = P.ParameterOnC1();
763 v = P.ParameterOnC2();
765 gp_Pnt2d pt2d1 = rst1->Value(u);
766 gp_Pnt2d pt2d2 = rst2->Value(v);
768 ptrst1 = cons1.Value(u);
769 ptrst2 = cons2.Value(v);
770 distmin = Min (distmin, ptrst1.Distance(ptrst2));
772 Poles2d(Poles2d.Lower()).SetCoord(pt2d1.X(),pt2d1.Y());
773 Poles2d(Poles2d.Upper()).SetCoord(pt2d2.X(),pt2d2.Y());
776 if (mySShape == BlendFunc_Linear) {
784 // Calculate the center of the circle
785 CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
787 // normals to the section with points
788 ns = gp_Vec(Center, ptrst1).Normalized();
789 ns2 = gp_Vec(Center, ptrst2).Normalized();
795 GeomFill::GetCircle(myTConv,
797 nplan, ptrst1, ptrst2,
802 //=======================================================================
805 //=======================================================================
807 Standard_Boolean BRepBlend_RstRstConstRad::Section(const Blend_Point& P,
808 TColgp_Array1OfPnt& Poles,
809 TColgp_Array1OfVec& DPoles,
810 TColgp_Array1OfPnt2d& Poles2d,
811 TColgp_Array1OfVec2d& DPoles2d,
812 TColStd_Array1OfReal& Weights,
813 TColStd_Array1OfReal& DWeights)
817 gp_Vec dnplan, d1n1, d1n2;//,np2, dnp2;
819 gp_Vec d1urst, d1vrst;
820 gp_Pnt Center, NotUsed;
822 Standard_Real norm2, normmed, Dist;
824 math_Vector sol(1, 2), valsol(1, 2), secmember(1, 2);
825 math_Matrix gradsol(1, 2, 1, 2);
827 Standard_Real prm = P.Parameter();
828 Standard_Integer low = Poles.Lower();
829 Standard_Integer upp = Poles.Upper();
830 Standard_Boolean istgt;
832 tguide->D2(prm, ptgui, d1gui, d2gui);
833 normtg = d1gui.Magnitude();
834 nplan = d1gui.Normalized();
835 dnplan.SetLinearForm(1./normtg, d2gui,
836 -1./normtg * (nplan.Dot(d2gui)), nplan);
838 sol(1) = prmrst1 = P.ParameterOnC1();
839 sol(2) = prmrst2 = P.ParameterOnC2();
840 pt2drst1 = rst1->Value(prmrst1);
841 pt2drst2 = rst2->Value(prmrst2);
843 Values(sol, valsol, gradsol);
845 cons1.D1(sol(1), ptrst1, d11);
846 cons2.D1(sol(2), ptrst2, d21);
848 temp.SetXYZ(ptrst1.XYZ() - ptgui.XYZ());
849 secmember(1) = normtg - dnplan.Dot(temp);
851 temp.SetXYZ(ptrst2.XYZ() - ptgui.XYZ());
852 secmember(2) = normtg - dnplan.Dot(temp);
854 math_Gauss Resol(gradsol, 1.e-9);
856 if (Resol.IsDone()) {
857 istgt = Standard_False;
858 Resol.Solve(secmember);
861 math_SVD SingRS (gradsol);
862 if (SingRS.IsDone()) {
863 math_Vector DEDT(1,2);
865 SingRS.Solve(DEDT, secmember, 1.e-6);
866 istgt = Standard_False;
868 else istgt = Standard_True;
872 gp_Vec rst1rst2(ptrst1, ptrst2);
873 Standard_Boolean IsCenter;
875 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, med);
876 if (!IsCenter) return Standard_False;
878 normmed = med.Magnitude();
880 gp_Vec n1(Center, ptrst1), n2(Center, ptrst2);
885 // secmember contains derivatives of parameters on curves
887 tgrst1 = secmember(1) * d11;
888 tgrst2 = secmember(2) * d21;
892 norm2 = rst1rst2.SquareMagnitude();
893 d1rst1rst2 = tgrst2 - tgrst1;
894 Dist = ray * ray - 0.25 * norm2;
897 gp_Vec d1P1P2CrosNp, dmed;
898 d1P1P2CrosNp = d1rst1rst2.Crossed(nplan) + rst1rst2.Crossed(dnplan);
899 // derivative of the perpendicular bisector
900 dmed = d1P1P2CrosNp - med.Dot(d1P1P2CrosNp) * med;
903 Standard_Real d1Dist = - (0.25 / Dist) * rst1rst2.Dot(d1rst1rst2);
909 // the derivative of coefficient Dist is located in dmed
910 dmed.SetLinearForm(Dist, dmed, d1Dist, med);
912 // derivative of the Normal to the curve in P1
913 d1n1 = - (dmed + d1rst1rst2) / ray;
915 // derivative of the Normal to the curve in P2
916 d1n2 = (d1rst1rst2 - dmed) / ray;
920 // Normal to the curve in P1
921 d1n1 = - d1rst1rst2 / ray;
923 // Normal to the curve in P2
924 d1n2 = d1rst1rst2 / ray;
930 Poles2d(Poles2d.Lower()).SetCoord(pt2drst1.X(), pt2drst1.Y());
931 Poles2d(Poles2d.Upper()).SetCoord(pt2drst2.X(), pt2drst2.Y());
934 surf1->D1(pt2drst1.X(), pt2drst1.Y(), NotUsed, d1urst, d1vrst);
935 t3dto2d(a,b,tgrst1, d1urst, d1vrst);
936 DPoles2d(Poles2d.Lower()).SetCoord(a, b);
938 surf2->D1(pt2drst2.X(), pt2drst2.Y(), NotUsed, d1urst, d1vrst);
939 t3dto2d(a, b, tgrst2, d1urst, d1vrst);
940 DPoles2d(Poles2d.Upper()).SetCoord(a, b);
944 if (mySShape == BlendFunc_Linear) {
950 DPoles(low) = tgrst1;
951 DPoles(upp) = tgrst2;
958 // Case of the circle
959 // tangent to the center of the circle
961 tgct.SetLinearForm(-ray, d1n1, tgrst1);
971 return GeomFill::GetCircle(myTConv,
985 GeomFill::GetCircle(myTConv,
987 nplan, ptrst1, ptrst2,
990 return Standard_False;
994 //=======================================================================
997 //=======================================================================
999 Standard_Boolean BRepBlend_RstRstConstRad::Section
1000 (const Blend_Point&,
1001 TColgp_Array1OfPnt&,
1002 TColgp_Array1OfVec&,
1003 TColgp_Array1OfVec&,
1004 TColgp_Array1OfPnt2d&,
1005 TColgp_Array1OfVec2d&,
1006 TColgp_Array1OfVec2d&,
1007 TColStd_Array1OfReal&,
1008 TColStd_Array1OfReal&,
1009 TColStd_Array1OfReal&)
1011 return Standard_False;
1015 void BRepBlend_RstRstConstRad::Resolution(const Standard_Integer IC2d,
1016 const Standard_Real Tol,
1017 Standard_Real& TolU,
1018 Standard_Real& TolV) const
1021 TolU = surf1->UResolution(Tol);
1022 TolV = surf1->VResolution(Tol);
1025 TolU = surf2->UResolution(Tol);
1026 TolV = surf2->VResolution(Tol);