1 // Created on: 1997-02-10
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
22 #include <BRepBlend_RstRstConstRad.ixx>
23 #include <math_Gauss.hxx>
24 #include <math_SVD.hxx>
28 #include <BlendFunc.hxx>
29 #include <GeomFill.hxx>
30 #include <Standard_DomainError.hxx>
31 #include <Standard_NotImplemented.hxx>
32 #include <Precision.hxx>
36 static void t3dto2d(Standard_Real& a,
42 Standard_Real AB = A.Dot(B);
43 Standard_Real AC = A.Dot(C);
44 Standard_Real BC = B.Dot(C);
45 Standard_Real BB = B.Dot(B);
46 Standard_Real CC = C.Dot(C);
47 Standard_Real deno = (BB*CC-BC*BC);
48 a = (AB*CC-AC*BC)/deno;
49 b = (AC*BB-AB*BC)/deno;
52 //=======================================================================
53 //function : BRepBlend_RstRstConstRad
55 //=======================================================================
57 BRepBlend_RstRstConstRad::BRepBlend_RstRstConstRad
58 (const Handle(Adaptor3d_HSurface)& Surf1,
59 const Handle(Adaptor2d_HCurve2d)& Rst1,
60 const Handle(Adaptor3d_HSurface)& Surf2,
61 const Handle(Adaptor2d_HCurve2d)& Rst2,
62 const Handle(Adaptor3d_HCurve)& CGuide):
63 surf1(Surf1), surf2(Surf2), rst1(Rst1), rst2(Rst2),
64 cons1(Rst1, Surf1), cons2(Rst2, Surf2),
65 guide(CGuide), tguide(CGuide),
66 istangent(Standard_True), maxang(RealFirst()), minang(RealLast()),
68 mySShape(BlendFunc_Rational)
71 //=======================================================================
72 //function : NbVariables
74 //=======================================================================
76 Standard_Integer BRepBlend_RstRstConstRad::NbVariables() const
81 //=======================================================================
82 //function : NbEquations
84 //=======================================================================
86 Standard_Integer BRepBlend_RstRstConstRad::NbEquations() const
91 //=======================================================================
94 //=======================================================================
96 Standard_Boolean BRepBlend_RstRstConstRad::Value(const math_Vector& X,
99 ptrst1 = cons1.Value(X(1));
100 ptrst2 = cons2.Value(X(2));
102 F(1) = nplan.XYZ().Dot(ptrst1.XYZ()) + theD;
103 F(2) = nplan.XYZ().Dot(ptrst2.XYZ()) + theD;
105 return Standard_True;
108 //=======================================================================
109 //function : Derivatives
111 //=======================================================================
113 Standard_Boolean BRepBlend_RstRstConstRad::Derivatives(const math_Vector& X,
118 cons1.D1(X(1), ptrst1, d11);
119 cons2.D1(X(2), ptrst2, d21);
121 D(1,1) = nplan.Dot(d11);
125 D(2,2) = nplan.Dot(d21);
127 return Standard_True;
130 //=======================================================================
133 //=======================================================================
135 Standard_Boolean BRepBlend_RstRstConstRad::Values(const math_Vector& X,
139 Standard_Boolean Error;
142 Error = Derivatives(X, D);
144 return Standard_True;
147 //=======================================================================
150 //=======================================================================
152 void BRepBlend_RstRstConstRad::Set(const Handle(Adaptor3d_HSurface)& SurfRef1,
153 const Handle(Adaptor2d_HCurve2d)& RstRef1,
154 const Handle(Adaptor3d_HSurface)& SurfRef2,
155 const Handle(Adaptor2d_HCurve2d)& RstRef2)
163 //=======================================================================
166 //=======================================================================
168 void BRepBlend_RstRstConstRad::Set(const Standard_Real Param)
170 tguide->D2(Param, ptgui, d1gui, d2gui);
171 normtg = d1gui.Magnitude();
172 nplan = d1gui.Normalized();
173 theD = - (nplan.XYZ().Dot(ptgui.XYZ()));
176 //=======================================================================
179 //=======================================================================
181 void BRepBlend_RstRstConstRad::Set(const Standard_Real First,
182 const Standard_Real Last)
184 tguide = guide->Trim(First, Last, 1.e-12);
187 //=======================================================================
188 //function : GetTolerance
190 //=======================================================================
192 void BRepBlend_RstRstConstRad::GetTolerance(math_Vector& Tolerance,
193 const Standard_Real Tol) const
195 Tolerance(1) = cons1.Resolution(Tol);
196 Tolerance(2) = cons2.Resolution(Tol);
199 //=======================================================================
200 //function : GetBounds
202 //=======================================================================
204 void BRepBlend_RstRstConstRad::GetBounds(math_Vector& InfBound,
205 math_Vector& SupBound) const
207 InfBound(1) = cons1.FirstParameter();
208 InfBound(2) = cons2.FirstParameter();
209 SupBound(1) = cons1.LastParameter();
210 SupBound(2) = cons2.LastParameter();
214 //=======================================================================
215 //function : IsSolution
217 //=======================================================================
219 Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol,
220 const Standard_Real Tol)
224 math_Vector valsol(1, 2), secmember(1, 2);
225 math_Matrix gradsol(1, 2, 1, 2);
227 gp_Vec dnplan, d1urst1, d1vrst1, d1urst2, d1vrst2, d11, d21, temp;
230 Standard_Real Cosa, Sina, Angle;
232 Values(Sol, valsol, gradsol);
234 if (Abs(valsol(1)) <= Tol &&
235 Abs(valsol(2)) <= Tol ) {
237 // Calculation of tangents
239 pt2drst1 = rst1->Value(prmrst1);
241 pt2drst2 = rst2->Value(prmrst2);
243 cons1.D1(Sol(1), ptrst1, d11);
244 cons2.D1(Sol(2), ptrst2, d21);
246 dnplan.SetLinearForm(1./normtg, d2gui,
247 -1./normtg * (nplan.Dot(d2gui)), nplan);
249 temp.SetXYZ(ptrst1.XYZ() - ptgui.XYZ());
250 secmember(1) = normtg - dnplan.Dot(temp);
252 temp.SetXYZ(ptrst2.XYZ() - ptgui.XYZ());
253 secmember(2) = normtg - dnplan.Dot(temp);
255 math_Gauss Resol(gradsol);
257 if (Resol.IsDone()) {
258 Resol.Solve(secmember);
259 istangent = Standard_False;
262 math_SVD SingRS (gradsol);
263 if (SingRS.IsDone()) {
264 math_Vector DEDT(1,3);
266 SingRS.Solve(DEDT, secmember, 1.e-6);
267 istangent = Standard_False;
269 else istangent = Standard_True;
274 tgrst1 = secmember(1) * d11;
275 tgrst2 = secmember(2) * d21;
278 surf1->D1(pt2drst1.X(), pt2drst1.Y(), bid, d1urst1, d1vrst1);
279 t3dto2d(a, b, tgrst1, d1urst1, d1vrst1);
280 tg2drst1.SetCoord(a, b);
281 surf2->D1(pt2drst2.X(), pt2drst2.Y(), bid, d1urst2, d1vrst2);
282 t3dto2d(a, b, tgrst1, d1urst2, d1vrst2);
283 tg2drst2.SetCoord(a, b);
288 Standard_Boolean IsCenter;
290 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
292 if (!IsCenter) return Standard_False;
294 gp_Vec n1(Center, ptrst1) , n2(Center, ptrst2);
300 Sina = nplan.Dot(n1.Crossed(n2));
303 Sina = -Sina; //nplan is changed into -nplan
308 Angle = 2.*M_PI - Angle;
311 if (Angle > maxang) {maxang = Angle;}
312 if (Angle < minang) {minang = Angle;}
313 distmin = Min( distmin, ptrst1.Distance(ptrst2));
315 return Standard_True;
317 istangent = Standard_True;
318 return Standard_False;
321 //=======================================================================
322 //function : GetMinimalDistance
324 //=======================================================================
326 Standard_Real BRepBlend_RstRstConstRad::GetMinimalDistance() const
331 //=======================================================================
332 //function : PointOnRst1
334 //=======================================================================
336 const gp_Pnt& BRepBlend_RstRstConstRad::PointOnRst1() const
341 //=======================================================================
342 //function : PointOnRst2
344 //=======================================================================
346 const gp_Pnt& BRepBlend_RstRstConstRad::PointOnRst2() const
351 //=======================================================================
352 //function : Pnt2dOnRst1
354 //=======================================================================
356 const gp_Pnt2d& BRepBlend_RstRstConstRad::Pnt2dOnRst1() const
361 //=======================================================================
362 //function : Pnt2dOnRst2
364 //=======================================================================
366 const gp_Pnt2d& BRepBlend_RstRstConstRad::Pnt2dOnRst2() const
371 //=======================================================================
372 //function : ParameterOnRst1
374 //=======================================================================
376 Standard_Real BRepBlend_RstRstConstRad::ParameterOnRst1() const
381 //=======================================================================
382 //function : ParameterOnRst2
384 //=======================================================================
386 Standard_Real BRepBlend_RstRstConstRad::ParameterOnRst2() const
390 //=======================================================================
391 //function : IsTangencyPoint
393 //=======================================================================
395 Standard_Boolean BRepBlend_RstRstConstRad::IsTangencyPoint() const
400 //=======================================================================
401 //function : TangentOnRst1
403 //=======================================================================
405 const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst1() const
407 if (istangent) {Standard_DomainError::Raise();}
411 //=======================================================================
412 //function : Tangent2dOnRst1
414 //=======================================================================
416 const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst1() const
418 if (istangent) {Standard_DomainError::Raise();}
422 //=======================================================================
423 //function : TangentOnRst2
425 //=======================================================================
427 const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst2() const
429 if (istangent) {Standard_DomainError::Raise();}
433 //=======================================================================
434 //function : Tangent2dOnRst2
436 //=======================================================================
438 const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst2() const
440 if (istangent) {Standard_DomainError::Raise();}
444 //=======================================================================
447 //=======================================================================
449 Blend_DecrochStatus BRepBlend_RstRstConstRad::Decroch(const math_Vector& Sol,
455 gp_Vec NRst1InPlane, NRst2InPlane;
456 gp_Pnt PtTmp1, PtTmp2, Center;
457 gp_Vec d1u, d1v, centptrst, NotUsed;
458 Standard_Real norm, unsurnorm;
461 rstref1->Value(Sol(1)).Coord(u, v);
462 surfref1->D1(u, v,PtTmp1,d1u,d1v);
463 // Normal to the reference surface 1
464 NRst1 = d1u.Crossed(d1v);
465 rstref2->Value(Sol(2)).Coord(u, v);
466 surfref2->D1(u, v, PtTmp2, d1u, d1v);
467 // Normal to the reference surface 2
468 NRst2 = d1u.Crossed(d1v);
470 Standard_Boolean IsCenter;
472 IsCenter = CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
474 norm = nplan.Crossed(NRst1).Magnitude();
475 unsurnorm = 1. / norm;
477 NRst1InPlane.SetLinearForm(nplan.Dot(NRst1) * unsurnorm, nplan, -unsurnorm, NRst1);
479 centptrst.SetXYZ(PtTmp1.XYZ() - Center.XYZ());
481 if (centptrst.Dot(NRst1InPlane) < 0.) NRst1InPlane.Reverse();
483 TgRst1 = nplan.Crossed(centptrst);
485 norm = nplan.Crossed(NRst2).Magnitude();
486 unsurnorm = 1./ norm;
487 NRst2InPlane.SetLinearForm(nplan.Dot(NRst2) * unsurnorm, nplan, -unsurnorm, NRst2);
488 centptrst.SetXYZ(PtTmp2.XYZ() - Center.XYZ());
491 if (centptrst.Dot(NRst2InPlane) < 0.) NRst2InPlane.Reverse();
493 TgRst2 = nplan.Crossed(centptrst);
500 // The vectors are returned
501 if (NRst1InPlane.Dot(TgRst1) > -1.e-10) {
502 if (NRst2InPlane.Dot(TgRst2) < 1.e-10) {
503 return Blend_DecrochBoth;
506 return Blend_DecrochRst1;
510 if (NRst2InPlane.Dot(TgRst2) < 1.e-10) {
511 return Blend_DecrochRst2;
514 return Blend_NoDecroch;
520 //=======================================================================
523 //=======================================================================
525 void BRepBlend_RstRstConstRad::Set(const Standard_Real Radius,
526 const Standard_Integer Choix)
533 //=======================================================================
536 //=======================================================================
538 void BRepBlend_RstRstConstRad::Set(const BlendFunc_SectionShape TypeSection)
540 mySShape = TypeSection;
545 //=======================================================================
546 //function : CenterCircleRst1Rst2
547 //purpose : Calculate the center of the circle passing by two points of restrictions
548 //=======================================================================
549 Standard_Boolean BRepBlend_RstRstConstRad::CenterCircleRst1Rst2(const gp_Pnt& PtRst1,
550 const gp_Pnt& PtRst2,
556 gp_Vec rst1rst2(PtRst1, PtRst2);
557 gp_Vec vdmedNor; //,NRst1; vdmedNor directong vector of the perpendicular bisector
559 Standard_Real Dist;// distance between the middle of PtRst1,PtRst2 and Center
561 // Calculate the center of the circle
562 VdMed = rst1rst2.Crossed(np);
563 norm2 = rst1rst2.SquareMagnitude();
564 Dist = ray * ray - 0.25 * norm2;
570 if (Dist < - 1.E-07) return Standard_False;
574 vdmedNor = VdMed.Normalized();
575 Center.SetXYZ(0.5 * rst1rst2.XYZ() + PtRst1.XYZ() + Dist * vdmedNor.XYZ());
579 Center.SetXYZ(0.5 * rst1rst2.XYZ() + PtRst1.XYZ());
582 return Standard_True;
591 //=======================================================================
594 //=======================================================================
596 void BRepBlend_RstRstConstRad::Section(const Standard_Real Param,
597 const Standard_Real U,
598 const Standard_Real V,
603 gp_Vec ns, np, NotUsed;
606 tguide->D1(Param, ptgui, d1gui);
607 np = d1gui.Normalized();
608 ptrst1 = cons1.Value(U);
609 ptrst2 = cons2.Value(V);
611 Standard_Boolean IsCenter;
613 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
615 C.SetRadius(Abs(ray));
616 ns = gp_Vec(Center, ptrst1).Normalized();
622 C.SetPosition(gp_Ax2(Center, np, ns));
623 Pdeb = 0; //ElCLib::Parameter(C, pts);
624 Pfin = ElCLib::Parameter(C, ptrst2);
626 // Test of angles negative and almost null : Special Case
627 if (Pfin > 1.5 * M_PI) {
629 C.SetPosition(gp_Ax2(Center, np, ns));
630 Pfin = ElCLib::Parameter(C, ptrst2);
632 if (Pfin < Precision::PConfusion()) Pfin += Precision::PConfusion();
635 //=======================================================================
636 //function : IsRational
638 //=======================================================================
640 Standard_Boolean BRepBlend_RstRstConstRad::IsRational () const
642 return (mySShape==BlendFunc_Rational || mySShape==BlendFunc_QuasiAngular);
645 //=======================================================================
646 //function : GetSectionSize
648 //=======================================================================
650 Standard_Real BRepBlend_RstRstConstRad::GetSectionSize() const
652 return maxang * Abs(ray);
655 //=======================================================================
656 //function : GetMinimalWeight
658 //=======================================================================
660 void BRepBlend_RstRstConstRad::GetMinimalWeight(TColStd_Array1OfReal& Weights) const
662 BlendFunc::GetMinimalWeights(mySShape, myTConv, minang, maxang, Weights );
663 // It is supposed that it does not depend on the Radius!
666 //=======================================================================
667 //function : NbIntervals
669 //=======================================================================
671 Standard_Integer BRepBlend_RstRstConstRad::NbIntervals (const GeomAbs_Shape S) const
673 return guide->NbIntervals(BlendFunc::NextShape(S));
676 //=======================================================================
677 //function : Intervals
679 //=======================================================================
681 void BRepBlend_RstRstConstRad::Intervals (TColStd_Array1OfReal& T,
682 const GeomAbs_Shape S) const
684 guide->Intervals(T, BlendFunc::NextShape(S));
687 //=======================================================================
688 //function : GetShape
690 //=======================================================================
692 void BRepBlend_RstRstConstRad::GetShape (Standard_Integer& NbPoles,
693 Standard_Integer& NbKnots,
694 Standard_Integer& Degree,
695 Standard_Integer& NbPoles2d)
698 BlendFunc::GetShape(mySShape, maxang, NbPoles, NbKnots, Degree, myTConv);
701 //=======================================================================
702 //function : GetTolerance
703 //purpose : Determine Tolerances to be used in approximations.
704 //=======================================================================
706 void BRepBlend_RstRstConstRad::GetTolerance(const Standard_Real BoundTol,
707 const Standard_Real SurfTol,
708 const Standard_Real AngleTol,
710 math_Vector& Tol1d) const
712 Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper();
714 Tol= GeomFill::GetTolerance(myTConv, minang, Abs(ray),
718 Tol3d(low+1) = Tol3d(up-1) = Min(Tol, SurfTol);
719 Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol);
722 //=======================================================================
725 //=======================================================================
727 void BRepBlend_RstRstConstRad::Knots(TColStd_Array1OfReal& TKnots)
729 GeomFill::Knots(myTConv, TKnots);
732 //=======================================================================
735 //=======================================================================
737 void BRepBlend_RstRstConstRad::Mults(TColStd_Array1OfInteger& TMults)
739 GeomFill::Mults(myTConv, TMults);
742 //=======================================================================
745 //=======================================================================
747 void BRepBlend_RstRstConstRad::Section(const Blend_Point& P,
748 TColgp_Array1OfPnt& Poles,
749 TColgp_Array1OfPnt2d& Poles2d,
750 TColStd_Array1OfReal& Weights)
752 gp_Vec ns, ns2, NotUsed;
756 Standard_Real prm = P.Parameter();
757 Standard_Integer low = Poles.Lower();
758 Standard_Integer upp = Poles.Upper();
760 tguide->D1(prm,ptgui, d1gui);
761 nplan = d1gui.Normalized();
763 u = P.ParameterOnC1();
764 v = P.ParameterOnC2();
766 gp_Pnt2d pt2d1 = rst1->Value(u);
767 gp_Pnt2d pt2d2 = rst2->Value(v);
769 ptrst1 = cons1.Value(u);
770 ptrst2 = cons2.Value(v);
771 distmin = Min (distmin, ptrst1.Distance(ptrst2));
773 Poles2d(Poles2d.Lower()).SetCoord(pt2d1.X(),pt2d1.Y());
774 Poles2d(Poles2d.Upper()).SetCoord(pt2d2.X(),pt2d2.Y());
777 if (mySShape == BlendFunc_Linear) {
785 // Calculate the center of the circle
786 Standard_Boolean IsCenter;
787 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
789 // normals to the section with points
790 ns = gp_Vec(Center, ptrst1).Normalized();
791 ns2 = gp_Vec(Center, ptrst2).Normalized();
797 GeomFill::GetCircle(myTConv,
799 nplan, ptrst1, ptrst2,
804 //=======================================================================
807 //=======================================================================
809 Standard_Boolean BRepBlend_RstRstConstRad::Section(const Blend_Point& P,
810 TColgp_Array1OfPnt& Poles,
811 TColgp_Array1OfVec& DPoles,
812 TColgp_Array1OfPnt2d& Poles2d,
813 TColgp_Array1OfVec2d& DPoles2d,
814 TColStd_Array1OfReal& Weights,
815 TColStd_Array1OfReal& DWeights)
819 gp_Vec dnplan, d1n1, d1n2;//,np2, dnp2;
821 gp_Vec d1urst, d1vrst;
822 gp_Pnt Center, NotUsed;
824 Standard_Real norm2, normmed, Dist;
826 math_Vector sol(1, 2), valsol(1, 2), secmember(1, 2);
827 math_Matrix gradsol(1, 2, 1, 2);
829 Standard_Real prm = P.Parameter();
830 Standard_Integer low = Poles.Lower();
831 Standard_Integer upp = Poles.Upper();
832 Standard_Boolean istgt;
834 tguide->D2(prm, ptgui, d1gui, d2gui);
835 normtg = d1gui.Magnitude();
836 nplan = d1gui.Normalized();
837 dnplan.SetLinearForm(1./normtg, d2gui,
838 -1./normtg * (nplan.Dot(d2gui)), nplan);
840 sol(1) = prmrst1 = P.ParameterOnC1();
841 sol(2) = prmrst2 = P.ParameterOnC2();
842 pt2drst1 = rst1->Value(prmrst1);
843 pt2drst2 = rst2->Value(prmrst2);
845 Values(sol, valsol, gradsol);
847 cons1.D1(sol(1), ptrst1, d11);
848 cons2.D1(sol(2), ptrst2, d21);
850 temp.SetXYZ(ptrst1.XYZ() - ptgui.XYZ());
851 secmember(1) = normtg - dnplan.Dot(temp);
853 temp.SetXYZ(ptrst2.XYZ() - ptgui.XYZ());
854 secmember(2) = normtg - dnplan.Dot(temp);
856 math_Gauss Resol(gradsol, 1.e-9);
858 if (Resol.IsDone()) {
859 istgt = Standard_False;
860 Resol.Solve(secmember);
863 math_SVD SingRS (gradsol);
864 if (SingRS.IsDone()) {
865 math_Vector DEDT(1,2);
867 SingRS.Solve(DEDT, secmember, 1.e-6);
868 istgt = Standard_False;
870 else istgt = Standard_True;
874 gp_Vec rst1rst2(ptrst1, ptrst2);
875 Standard_Boolean IsCenter;
877 IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, med);
878 if (!IsCenter) return Standard_False;
880 normmed = med.Magnitude();
882 gp_Vec n1(Center, ptrst1), n2(Center, ptrst2);
887 // secmember contains derivatives of parameters on curves
889 tgrst1 = secmember(1) * d11;
890 tgrst2 = secmember(2) * d21;
894 norm2 = rst1rst2.SquareMagnitude();
895 d1rst1rst2 = tgrst2 - tgrst1;
896 Dist = ray * ray - 0.25 * norm2;
899 gp_Vec d1P1P2CrosNp, dmed;
900 d1P1P2CrosNp = d1rst1rst2.Crossed(nplan) + rst1rst2.Crossed(dnplan);
901 // derivative of the perpendicular bisector
902 dmed = d1P1P2CrosNp - med.Dot(d1P1P2CrosNp) * med;
905 Standard_Real d1Dist = - (0.25 / Dist) * rst1rst2.Dot(d1rst1rst2);
911 // the derivative of coefficient Dist is located in dmed
912 dmed.SetLinearForm(Dist, dmed, d1Dist, med);
914 // derivative of the Normal to the curve in P1
915 d1n1 = - (dmed + d1rst1rst2) / ray;
917 // derivative of the Normal to the curve in P2
918 d1n2 = (d1rst1rst2 - dmed) / ray;
922 // Normal to the curve in P1
923 d1n1 = - d1rst1rst2 / ray;
925 // Normal to the curve in P2
926 d1n2 = d1rst1rst2 / ray;
932 Poles2d(Poles2d.Lower()).SetCoord(pt2drst1.X(), pt2drst1.Y());
933 Poles2d(Poles2d.Upper()).SetCoord(pt2drst2.X(), pt2drst2.Y());
936 surf1->D1(pt2drst1.X(), pt2drst1.Y(), NotUsed, d1urst, d1vrst);
937 t3dto2d(a,b,tgrst1, d1urst, d1vrst);
938 DPoles2d(Poles2d.Lower()).SetCoord(a, b);
940 surf2->D1(pt2drst2.X(), pt2drst2.Y(), NotUsed, d1urst, d1vrst);
941 t3dto2d(a, b, tgrst2, d1urst, d1vrst);
942 DPoles2d(Poles2d.Upper()).SetCoord(a, b);
946 if (mySShape == BlendFunc_Linear) {
952 DPoles(low) = tgrst1;
953 DPoles(upp) = tgrst2;
960 // Case of the circle
961 // tangent to the center of the circle
963 tgct.SetLinearForm(-ray, d1n1, tgrst1);
973 return GeomFill::GetCircle(myTConv,
987 GeomFill::GetCircle(myTConv,
989 nplan, ptrst1, ptrst2,
992 return Standard_False;
996 //=======================================================================
999 //=======================================================================
1001 Standard_Boolean BRepBlend_RstRstConstRad::Section
1002 (const Blend_Point&,
1003 TColgp_Array1OfPnt&,
1004 TColgp_Array1OfVec&,
1005 TColgp_Array1OfVec&,
1006 TColgp_Array1OfPnt2d&,
1007 TColgp_Array1OfVec2d&,
1008 TColgp_Array1OfVec2d&,
1009 TColStd_Array1OfReal&,
1010 TColStd_Array1OfReal&,
1011 TColStd_Array1OfReal&)
1013 return Standard_False;
1017 void BRepBlend_RstRstConstRad::Resolution(const Standard_Integer IC2d,
1018 const Standard_Real Tol,
1019 Standard_Real& TolU,
1020 Standard_Real& TolV) const
1023 TolU = surf1->UResolution(Tol);
1024 TolV = surf1->VResolution(Tol);
1027 TolU = surf2->UResolution(Tol);
1028 TolV = surf2->VResolution(Tol);