1 // Created on: 1991-06-25
3 // Copyright (c) 1991-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 // 24-Aug-95 : xab removed C1 and C2 test : appeller D1 et D2
23 // avec discernement !
24 // 19-09-97 : JPI correction derivee seconde
27 #include <Geom_OffsetCurve.ixx>
32 #include <Geom_Line.hxx>
33 #include <Geom_Circle.hxx>
34 #include <Geom_Ellipse.hxx>
35 #include <Geom_Hyperbola.hxx>
36 #include <Geom_Parabola.hxx>
37 #include <Geom_BezierCurve.hxx>
38 #include <Geom_TrimmedCurve.hxx>
39 #include <Geom_BSplineCurve.hxx>
40 #include <Geom_Geometry.hxx>
42 #include <Geom_UndefinedDerivative.hxx>
43 #include <Geom_UndefinedValue.hxx>
44 #include <Standard_ConstructionError.hxx>
45 #include <Standard_RangeError.hxx>
46 #include <Standard_NotImplemented.hxx>
48 typedef Geom_OffsetCurve OffsetCurve;
49 typedef Handle(Geom_OffsetCurve) Handle(OffsetCurve);
50 typedef Geom_Curve Curve;
51 typedef Handle(Geom_Curve) Handle(Curve);
52 typedef Handle(Geom_Geometry) Handle(Geometry);
63 //ordre de derivation maximum pour la recherche de la premiere
65 static const int maxDerivOrder = 3;
66 static const Standard_Real MinStep = 1e-7;
71 //=======================================================================
74 //=======================================================================
76 Handle(Geom_Geometry) Geom_OffsetCurve::Copy () const {
78 Handle(OffsetCurve) C;
79 C = new OffsetCurve (basisCurve, offsetValue, direction);
85 //=======================================================================
86 //function : Geom_OffsetCurve
88 //=======================================================================
90 Geom_OffsetCurve::Geom_OffsetCurve (const Handle(Curve)& C,
91 const Standard_Real Offset,
93 : direction(V), offsetValue(Offset)
95 if (C->DynamicType() == STANDARD_TYPE(Geom_OffsetCurve)) {
96 Handle(OffsetCurve) OC = Handle(OffsetCurve)::DownCast(C);
97 SetBasisCurve (OC->BasisCurve());
99 Standard_Real PrevOff = OC->Offset();
100 gp_Vec V1(OC->Direction());
101 gp_Vec V2(direction);
102 gp_Vec Vdir(PrevOff*V1 + offsetValue*V2);
105 offsetValue = Vdir.Magnitude();
106 direction.SetXYZ(Vdir.XYZ());
108 offsetValue = -Vdir.Magnitude();
109 direction.SetXYZ((-Vdir).XYZ());
118 //=======================================================================
121 //=======================================================================
123 void Geom_OffsetCurve::Reverse ()
125 basisCurve->Reverse();
126 offsetValue = -offsetValue;
130 //=======================================================================
131 //function : ReversedParameter
133 //=======================================================================
135 Standard_Real Geom_OffsetCurve::ReversedParameter( const Standard_Real U) const
137 return basisCurve->ReversedParameter( U);
140 //=======================================================================
141 //function : Direction
143 //=======================================================================
145 const gp_Dir& Geom_OffsetCurve::Direction () const
146 { return direction; }
148 //=======================================================================
149 //function : SetDirection
151 //=======================================================================
153 void Geom_OffsetCurve::SetDirection (const Dir& V)
156 //=======================================================================
157 //function : SetOffsetValue
159 //=======================================================================
161 void Geom_OffsetCurve::SetOffsetValue (const Standard_Real D)
165 //=======================================================================
166 //function : IsPeriodic
168 //=======================================================================
170 Standard_Boolean Geom_OffsetCurve::IsPeriodic () const
172 return basisCurve->IsPeriodic();
175 //=======================================================================
178 //=======================================================================
180 Standard_Real Geom_OffsetCurve::Period () const
182 return basisCurve->Period();
185 //=======================================================================
186 //function : SetBasisCurve
188 //=======================================================================
190 void Geom_OffsetCurve::SetBasisCurve (const Handle(Curve)& C)
192 Handle(Curve) aBasisCurve = Handle(Curve)::DownCast(C->Copy());
194 // Basis curve must be at least C1
195 if (aBasisCurve->Continuity() == GeomAbs_C0)
197 // For B-splines it is sometimes possible to increase continuity by removing
198 // unnecessarily duplicated knots
199 if (aBasisCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve)))
201 Handle(Geom_BSplineCurve) aBCurve = Handle(Geom_BSplineCurve)::DownCast(aBasisCurve);
202 Standard_Integer degree = aBCurve->Degree();
203 Standard_Real Toler = Precision::Confusion();
204 Standard_Integer start = aBCurve->IsPeriodic() ? 1 : aBCurve->FirstUKnotIndex(),
205 finish = aBCurve->IsPeriodic() ? aBCurve->NbKnots() : aBCurve->LastUKnotIndex();
206 for (Standard_Integer i = start; i <= finish; i++)
208 Standard_Integer mult = aBCurve->Multiplicity(i);
209 if ( mult == degree )
210 aBCurve->RemoveKnot(i,degree - 1, Toler);
214 // Raise exception if still C0
215 if (aBasisCurve->Continuity() == GeomAbs_C0)
216 Standard_ConstructionError::Raise("Offset on C0 curve");
219 basisCurve = aBasisCurve;
224 //=======================================================================
225 //function : BasisCurve
227 //=======================================================================
229 Handle(Curve) Geom_OffsetCurve::BasisCurve () const
235 //=======================================================================
236 //function : Continuity
238 //=======================================================================
240 GeomAbs_Shape Geom_OffsetCurve::Continuity () const {
242 GeomAbs_Shape OffsetShape=GeomAbs_C0;
243 switch (basisCurve->Continuity()) {
244 case GeomAbs_C0 : OffsetShape = GeomAbs_C0; break;
245 case GeomAbs_C1 : OffsetShape = GeomAbs_C0; break;
246 case GeomAbs_C2 : OffsetShape = GeomAbs_C1; break;
247 case GeomAbs_C3 : OffsetShape = GeomAbs_C2; break;
248 case GeomAbs_CN : OffsetShape = GeomAbs_CN; break;
249 case GeomAbs_G1 : OffsetShape = GeomAbs_G1; break;
250 case GeomAbs_G2 : OffsetShape = GeomAbs_G2; break;
256 //=======================================================================
259 //=======================================================================
261 void Geom_OffsetCurve::D0 (const Standard_Real U, Pnt& P) const
265 D0(U,P,PBasis,VBasis);
269 //=======================================================================
272 //=======================================================================
274 void Geom_OffsetCurve::D1 (const Standard_Real U, Pnt& P, Vec& V1) const
277 gp_Vec V1Basis,V2Basis;
278 D1(U,P,PBasis,V1,V1Basis,V2Basis);
283 //=======================================================================
286 //=======================================================================
288 void Geom_OffsetCurve::D2 (const Standard_Real U, Pnt& P, Vec& V1, Vec& V2) const
291 gp_Vec V1Basis,V2Basis,V3Basis;
292 D2(U,P,PBasis,V1,V2,V1Basis,V2Basis,V3Basis);
296 //=======================================================================
299 //=======================================================================
301 void Geom_OffsetCurve::D3 (const Standard_Real theU, Pnt& P, Vec& theV1, Vec& V2, Vec& V3)
305 // P(u) = p(u) + Offset * Ndir / R
306 // with R = || p' ^ V|| and Ndir = P' ^ direction (local normal direction)
308 // P'(u) = p'(u) + (Offset / R**2) * (DNdir/DU * R - Ndir * (DR/R))
310 // P"(u) = p"(u) + (Offset / R) * (D2Ndir/DU - DNdir * (2.0 * Dr/ R**2) +
311 // Ndir * ( (3.0 * Dr**2 / R**4) - (D2r / R**2)))
313 //P"'(u) = p"'(u) + (Offset / R) * (D3Ndir - (3.0 * Dr/R**2) * D2Ndir -
314 // (3.0 * D2r / R2) * DNdir + (3.0 * Dr * Dr / R4) * DNdir -
315 // (D3r/R2) * Ndir + (6.0 * Dr * Dr / R4) * Ndir +
316 // (6.0 * Dr * D2r / R4) * Ndir - (15.0 * Dr* Dr* Dr /R6) * Ndir
318 const Standard_Real aTol = gp::Resolution();
320 Standard_Boolean IsDirectionChange = Standard_False;
322 basisCurve->D3 (theU, P, theV1, V2, V3);
323 Vec V4 = basisCurve->DN (theU, 4);
324 if(theV1.Magnitude() <= aTol)
326 const Standard_Real anUinfium = basisCurve->FirstParameter();
327 const Standard_Real anUsupremum = basisCurve->LastParameter();
329 const Standard_Real DivisionFactor = 1.e-3;
331 if((anUsupremum >= RealLast()) || (anUinfium <= RealFirst()))
334 du = anUsupremum-anUinfium;
336 const Standard_Real aDelta = Max(du*DivisionFactor,MinStep);
337 //Derivative is approximated by Taylor-series
339 Standard_Integer anIndex = 1; //Derivative order
344 V = basisCurve->DN(theU,++anIndex);
346 while((V.Magnitude() <= aTol) && anIndex < maxDerivOrder);
350 if(theU-anUinfium < aDelta)
356 basisCurve->D0(Min(theU, u),P1);
357 basisCurve->D0(Max(theU, u),P2);
360 Standard_Real aDirFactor = V.Dot(V1);
365 V2 = -basisCurve->DN (theU, anIndex + 1);
366 V3 = -basisCurve->DN (theU, anIndex + 2);
367 V4 = -basisCurve->DN (theU, anIndex + 3);
369 IsDirectionChange = Standard_True;
374 V2 = basisCurve->DN (theU, anIndex + 1);
375 V3 = basisCurve->DN (theU, anIndex + 2);
376 V4 = basisCurve->DN (theU, anIndex + 3);
378 }//if(V1.Magnitude() <= aTol)
381 XYZ OffsetDir = direction.XYZ();
382 XYZ Ndir = (theV1.XYZ()).Crossed (OffsetDir);
383 XYZ DNdir = (V2.XYZ()).Crossed (OffsetDir);
384 XYZ D2Ndir = (V3.XYZ()).Crossed (OffsetDir);
385 XYZ D3Ndir = (V4.XYZ()).Crossed (OffsetDir);
386 Standard_Real R2 = Ndir.SquareModulus();
387 Standard_Real R = Sqrt (R2);
388 Standard_Real R3 = R2 * R;
389 Standard_Real R4 = R2 * R2;
390 Standard_Real R5 = R3 * R2;
391 Standard_Real R6 = R3 * R3;
392 Standard_Real R7 = R5 * R2;
393 Standard_Real Dr = Ndir.Dot (DNdir);
394 Standard_Real D2r = Ndir.Dot (D2Ndir) + DNdir.Dot (DNdir);
395 Standard_Real D3r = Ndir.Dot (D3Ndir) + 3.0 * DNdir.Dot (D2Ndir);
396 if (R7 <= gp::Resolution()) {
397 if (R6 <= gp::Resolution()) Geom_UndefinedDerivative::Raise();
399 D3Ndir.Subtract (D2Ndir.Multiplied (3.0 * Dr / R2));
400 D3Ndir.Subtract (DNdir.Multiplied (3.0 * ((D2r/R2) + (Dr*Dr/R4))));
401 D3Ndir.Add (Ndir.Multiplied (6.0*Dr*Dr/R4 + 6.0*Dr*D2r/R4 -
402 15.0*Dr*Dr*Dr/R6 - D3r));
403 D3Ndir.Multiply (offsetValue/R);
405 if(IsDirectionChange)
408 V3.Add (Vec(D3Ndir));
411 Standard_Real R4 = R2 * R2;
412 D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R2));
413 D2Ndir.Subtract (Ndir.Multiplied ((3.0 * Dr * Dr / R4) - (D2r / R2)));
414 D2Ndir.Multiply (offsetValue / R);
415 V2.Add (Vec(D2Ndir));
418 DNdir.Subtract (Ndir.Multiplied (Dr/R));
419 DNdir.Multiply (offsetValue/R2);
420 theV1.Add (Vec(DNdir));
425 D3Ndir.Subtract (D2Ndir.Multiplied (3.0 * Dr / R3));
426 D3Ndir.Subtract (DNdir.Multiplied ((3.0 * ((D2r/R3) + (Dr*Dr)/R5))));
427 D3Ndir.Add (Ndir.Multiplied (6.0*Dr*Dr/R5 + 6.0*Dr*D2r/R5 -
428 15.0*Dr*Dr*Dr/R7 - D3r));
429 D3Ndir.Multiply (offsetValue);
431 if(IsDirectionChange)
434 V3.Add (Vec(D3Ndir));
438 D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R3));
439 D2Ndir.Subtract (Ndir.Multiplied ((3.0 * Dr * Dr / R5) - (D2r / R3)));
440 D2Ndir.Multiply (offsetValue);
441 V2.Add (Vec(D2Ndir));
443 DNdir.Multiply (offsetValue/R);
444 DNdir.Subtract (Ndir.Multiplied (offsetValue*Dr/R3));
445 theV1.Add (Vec(DNdir));
452 //=======================================================================
455 //=======================================================================
457 Vec Geom_OffsetCurve::DN (const Standard_Real U, const Standard_Integer N) const
459 Standard_RangeError_Raise_if (N < 1, "Exception: "
460 "Geom_OffsetCurve::DN(...). N<1.");
470 D2( U, Ptemp, Vtemp, VN);
473 D3( U, Ptemp, Vtemp, Vtemp, VN);
476 Standard_NotImplemented::Raise("Exception: "
477 "Derivative order is greater than 3. Cannot compute of derivative.");
483 //=======================================================================
486 //=======================================================================
488 void Geom_OffsetCurve::D0(const Standard_Real theU, gp_Pnt& theP,
489 gp_Pnt& thePbasis, gp_Vec& theV1basis)const
491 const Standard_Real aTol = gp::Resolution();
493 basisCurve->D1 (theU, thePbasis, theV1basis);
494 Standard_Real Ndu = theV1basis.Magnitude();
498 const Standard_Real anUinfium = basisCurve->FirstParameter();
499 const Standard_Real anUsupremum = basisCurve->LastParameter();
501 const Standard_Real DivisionFactor = 1.e-3;
503 if((anUsupremum >= RealLast()) || (anUinfium <= RealFirst()))
506 du = anUsupremum-anUinfium;
508 const Standard_Real aDelta = Max(du*DivisionFactor,MinStep);
509 //Derivative is approximated by Taylor-series
511 Standard_Integer anIndex = 1; //Derivative order
516 V = basisCurve->DN(theU,++anIndex);
519 while((Ndu <= aTol) && anIndex < maxDerivOrder);
523 if(theU-anUinfium < aDelta)
529 basisCurve->D0(Min(theU, u),P1);
530 basisCurve->D0(Max(theU, u),P2);
533 Standard_Real aDirFactor = V.Dot(V1);
540 Ndu = theV1basis.Magnitude();
543 XYZ Ndir = (theV1basis.XYZ()).Crossed (direction.XYZ());
544 Standard_Real R = Ndir.Modulus();
545 if (R <= gp::Resolution())
546 Geom_UndefinedValue::Raise("Exception: Undefined normal vector "
547 "because tangent vector has zero-magnitude!");
549 Ndir.Multiply (offsetValue/R);
550 Ndir.Add (thePbasis.XYZ());
554 //=======================================================================
557 //=======================================================================
559 void Geom_OffsetCurve::D1 ( const Standard_Real theU,
560 Pnt& P , Pnt& PBasis ,
561 Vec& theV1, Vec& V1basis, Vec& V2basis) const {
563 // P(u) = p(u) + Offset * Ndir / R
564 // with R = || p' ^ V|| and Ndir = P' ^ direction (local normal direction)
566 // P'(u) = p'(u) + (Offset / R**2) * (DNdir/DU * R - Ndir * (DR/R))
568 const Standard_Real aTol = gp::Resolution();
570 basisCurve->D2 (theU, PBasis, V1basis, V2basis);
574 if(theV1.Magnitude() <= aTol)
576 const Standard_Real anUinfium = basisCurve->FirstParameter();
577 const Standard_Real anUsupremum = basisCurve->LastParameter();
579 const Standard_Real DivisionFactor = 1.e-3;
581 if((anUsupremum >= RealLast()) || (anUinfium <= RealFirst()))
584 du = anUsupremum-anUinfium;
586 const Standard_Real aDelta = Max(du*DivisionFactor,MinStep);
587 //Derivative is approximated by Taylor-series
589 Standard_Integer anIndex = 1; //Derivative order
594 V = basisCurve->DN(theU,++anIndex);
596 while((V.Magnitude() <= aTol) && anIndex < maxDerivOrder);
600 if(theU-anUinfium < aDelta)
606 basisCurve->D0(Min(theU, u),P1);
607 basisCurve->D0(Max(theU, u),P2);
610 Standard_Real aDirFactor = V.Dot(V1);
615 V2 = - basisCurve->DN (theU, anIndex+1);
620 V2 = basisCurve->DN (theU, anIndex+1);
625 }//if(theV1.Magnitude() <= aTol)
627 XYZ OffsetDir = direction.XYZ();
628 XYZ Ndir = (theV1.XYZ()).Crossed (OffsetDir);
629 XYZ DNdir = (V2.XYZ()).Crossed (OffsetDir);
630 Standard_Real R2 = Ndir.SquareModulus();
631 Standard_Real R = Sqrt (R2);
632 Standard_Real R3 = R * R2;
633 Standard_Real Dr = Ndir.Dot (DNdir);
634 if (R3 <= gp::Resolution()) {
635 //We try another computation but the stability is not very good.
636 if (R2 <= gp::Resolution()) Geom_UndefinedDerivative::Raise();
638 DNdir.Subtract (Ndir.Multiplied (Dr/R));
639 DNdir.Multiply (offsetValue/R2);
640 theV1.Add (Vec(DNdir));
643 // Same computation as IICURV in EUCLID-IS because the stability is
645 DNdir.Multiply (offsetValue/R);
646 DNdir.Subtract (Ndir.Multiplied (offsetValue * Dr/R3));
647 theV1.Add (Vec(DNdir));
653 //=======================================================================
656 //=======================================================================
658 void Geom_OffsetCurve::D2 (const Standard_Real theU,
659 Pnt& P , Pnt& PBasis ,
660 Vec& theV1 , Vec& V2 ,
661 Vec& V1basis, Vec& V2basis, Vec& V3basis) const {
663 // P(u) = p(u) + Offset * Ndir / R
664 // with R = || p' ^ V|| and Ndir = P' ^ direction (local normal direction)
666 // P'(u) = p'(u) + (Offset / R**2) * (DNdir/DU * R - Ndir * (DR/R))
668 // P"(u) = p"(u) + (Offset / R) * (D2Ndir/DU - DNdir * (2.0 * Dr/ R**2) +
669 // Ndir * ( (3.0 * Dr**2 / R**4) - (D2r / R**2)))
671 const Standard_Real aTol = gp::Resolution();
673 Standard_Boolean IsDirectionChange = Standard_False;
675 basisCurve->D3 (theU, PBasis, V1basis, V2basis, V3basis);
681 if(theV1.Magnitude() <= aTol)
683 const Standard_Real anUinfium = basisCurve->FirstParameter();
684 const Standard_Real anUsupremum = basisCurve->LastParameter();
686 const Standard_Real DivisionFactor = 1.e-3;
688 if((anUsupremum >= RealLast()) || (anUinfium <= RealFirst()))
691 du = anUsupremum-anUinfium;
693 const Standard_Real aDelta = Max(du*DivisionFactor,MinStep);
694 //Derivative is approximated by Taylor-series
696 Standard_Integer anIndex = 1; //Derivative order
701 V = basisCurve->DN(theU,++anIndex);
703 while((V.Magnitude() <= aTol) && anIndex < maxDerivOrder);
707 if(theU-anUinfium < aDelta)
713 basisCurve->D0(Min(theU, u),P1);
714 basisCurve->D0(Max(theU, u),P2);
717 Standard_Real aDirFactor = V.Dot(V1);
722 V2 = -basisCurve->DN (theU, anIndex+1);
723 V3 = -basisCurve->DN (theU, anIndex + 2);
725 IsDirectionChange = Standard_True;
730 V2 = basisCurve->DN (theU, anIndex+1);
731 V3 = basisCurve->DN (theU, anIndex + 2);
736 }//if(V1.Magnitude() <= aTol)
738 XYZ OffsetDir = direction.XYZ();
739 XYZ Ndir = (theV1.XYZ()).Crossed (OffsetDir);
740 XYZ DNdir = (V2.XYZ()).Crossed (OffsetDir);
741 XYZ D2Ndir = (V3.XYZ()).Crossed (OffsetDir);
742 Standard_Real R2 = Ndir.SquareModulus();
743 Standard_Real R = Sqrt (R2);
744 Standard_Real R3 = R2 * R;
745 Standard_Real R4 = R2 * R2;
746 Standard_Real R5 = R3 * R2;
747 Standard_Real Dr = Ndir.Dot (DNdir);
748 Standard_Real D2r = Ndir.Dot (D2Ndir) + DNdir.Dot (DNdir);
750 if (R5 <= gp::Resolution()) {
751 //We try another computation but the stability is not very good
753 if (R4 <= gp::Resolution()) Geom_UndefinedDerivative::Raise();
755 Standard_Real R4 = R2 * R2;
756 D2Ndir.Subtract (DNdir.Multiplied (2.0 * Dr / R2));
757 D2Ndir.Add (Ndir.Multiplied (((3.0 * Dr * Dr)/R4) - (D2r/R2)));
758 D2Ndir.Multiply (offsetValue / R);
760 if(IsDirectionChange)
763 V2.Add (Vec(D2Ndir));
767 DNdir.Subtract (Ndir.Multiplied (Dr/R));
768 DNdir.Multiply (offsetValue/R2);
769 theV1.Add (Vec(DNdir));
772 // Same computation as IICURV in EUCLID-IS because the stability is
775 D2Ndir.Multiply (offsetValue/R);
776 D2Ndir.Subtract (DNdir.Multiplied (2.0 * offsetValue * Dr / R3));
777 D2Ndir.Add (Ndir.Multiplied (
778 offsetValue * (((3.0 * Dr * Dr) / R5) - (D2r / R3))
782 if(IsDirectionChange)
785 V2.Add (Vec(D2Ndir));
788 DNdir.Multiply (offsetValue/R);
789 DNdir.Subtract (Ndir.Multiplied (offsetValue*Dr/R3));
790 theV1.Add (Vec(DNdir));
797 //=======================================================================
798 //function : FirstParameter
800 //=======================================================================
802 Standard_Real Geom_OffsetCurve::FirstParameter () const {
804 return basisCurve->FirstParameter();
808 //=======================================================================
809 //function : LastParameter
811 //=======================================================================
813 Standard_Real Geom_OffsetCurve::LastParameter () const {
815 return basisCurve->LastParameter();
819 //=======================================================================
822 //=======================================================================
824 Standard_Real Geom_OffsetCurve::Offset () const { return offsetValue; }
826 //=======================================================================
829 //=======================================================================
831 void Geom_OffsetCurve::Value (const Standard_Real theU, Pnt& theP,
832 Pnt& thePbasis, Vec& theV1basis) const
834 if (basisCurve->Continuity() == GeomAbs_C0)
835 Geom_UndefinedValue::Raise("Exception: Basis curve is C0 continuity!");
837 basisCurve->D1(theU, thePbasis, theV1basis);
842 //=======================================================================
843 //function : IsClosed
845 //=======================================================================
847 Standard_Boolean Geom_OffsetCurve::IsClosed () const
850 D0(FirstParameter(),PF);
851 D0(LastParameter(),PL);
852 return ( PF.Distance(PL) <= gp::Resolution());
857 //=======================================================================
860 //=======================================================================
862 Standard_Boolean Geom_OffsetCurve::IsCN (const Standard_Integer N) const {
864 Standard_RangeError_Raise_if (N < 0, " ");
865 return basisCurve->IsCN (N + 1);
869 //=======================================================================
870 //function : Transform
872 //=======================================================================
874 void Geom_OffsetCurve::Transform (const Trsf& T) {
876 basisCurve->Transform (T);
877 direction.Transform(T);
878 offsetValue *= T.ScaleFactor();
881 //=======================================================================
882 //function : TransformedParameter
884 //=======================================================================
886 Standard_Real Geom_OffsetCurve::TransformedParameter(const Standard_Real U,
887 const gp_Trsf& T) const
889 return basisCurve->TransformedParameter(U,T);
892 //=======================================================================
893 //function : ParametricTransformation
895 //=======================================================================
897 Standard_Real Geom_OffsetCurve::ParametricTransformation(const gp_Trsf& T)
900 return basisCurve->ParametricTransformation(T);