opennurbs_curve.h
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 ////////////////////////////////////////////////////////////////
18 //
19 // Definition of virtual parametric curve
20 //
21 ////////////////////////////////////////////////////////////////
22 
23 #if !defined(OPENNURBS_CURVE_INC_)
24 #define OPENNURBS_CURVE_INC_
25 
26 ////////////////////////////////////////////////////////////////
27 ////////////////////////////////////////////////////////////////
28 
29 class ON_CLASS ON_MeshCurveParameters
30 {
31 public:
33 
34  // If main_seg_count <= 0, then both these parameters are ignored.
35  // If main_seg_count > 0, then sub_seg_count must be >= 1. In this
36  // case the curve will be broken into main_seg_count equally spaced
37  // chords. If needed, each of these chords can be split into as many
38  // sub_seg_count sub-parts if the subdivision is necessary for the
39  // mesh to meet the other meshing constraints. In particular, if
40  // sub_seg_count = 0, then the curve is broken into main_seg_count
41  // pieces and no further testing is performed.
44 
47 
48  // Maximum angle (in radians) between unit tangents at adjacent
49  // vertices.
51 
52  // Maximum permitted value of
53  // distance chord midpoint to curve) / (length of chord)
54  double m_max_chr;
55 
56  // If max_aspect < 1.0, the parameter is ignored.
57  // If 1 <= max_aspect < sqrt(2), it is treated as if
58  // max_aspect = sqrt(2).
59  // This parameter controls the maximum permitted value of
60  // (length of longest chord) / (length of shortest chord)
61  double m_max_aspect;
62 
63  // If tolerance = 0, the parameter is ignored.
64  // This parameter controls the maximum permitted value of the
65  // distance from the curve to the mesh.
66  double m_tolerance;
67 
68  // If m_min_edge_length = 0, the parameter is ignored.
69  // This parameter controls the minimum permitted edge length.
71 
72  // If max_edge_length = 0, the parameter is ignored.
73  // This parameter controls the maximum permitted edge length.
75 
76  double m_reserved3;
77  double m_reserved4;
78 };
79 
80 /*
81 Description:
82  ON_Curve is a pure virtual class for curve objects
83  - Any class derived from ON_Curve should have a
84  ON_OBJECT_DECLARE(ON_...);
85  at the beginning of its class definition and a
86  ON_OBJECT_IMPLEMENT( ON_..., ON_Curve );
87  in a .cpp file.
88 Example:
89  - See the definition of ON_NurbsCurve for an example.
90 */
91 class ON_CLASS ON_Curve : public ON_Geometry
92 {
93  ON_OBJECT_DECLARE(ON_Curve);
94 
95 public:
96  ON_Curve() ON_NOEXCEPT;
97  virtual ~ON_Curve();
98  ON_Curve(const ON_Curve&);
99  ON_Curve& operator=(const ON_Curve&);
100 
101 #if defined(ON_HAS_RVALUEREF)
102  // rvalue copy constructor
103  ON_Curve( ON_Curve&& ) ON_NOEXCEPT;
104 
105  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
106  // which could throw exceptions. See the implementation of
107  // ON_Object::operator=(ON_Object&&) for details.
108  ON_Curve& operator=( ON_Curve&& );
109 #endif
110 
111 public:
112  // virtual ON_Object::DestroyRuntimeCache override
113  void DestroyRuntimeCache( bool bDelete = true ) override;
114 
115  // virtual ON_Object::SizeOf override
116  unsigned int SizeOf() const override;
117 
118  // virtual ON_Geometry override
119  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
120 
121  /*
122  Description:
123  Get a duplicate of the curve.
124  Returns:
125  A duplicate of the curve.
126  Remarks:
127  The caller must delete the returned curve.
128  For non-ON_CurveProxy objects, this simply duplicates the curve using
129  ON_Object::Duplicate.
130  For ON_CurveProxy objects, this duplicates the actual proxy curve
131  geometry and, if necessary, trims and reverse the result to that
132  the returned curve's parameterization and locus match the proxy curve's.
133  */
134  virtual
135  ON_Curve* DuplicateCurve() const;
136 
137  // Description:
138  // overrides virtual ON_Object::ObjectType.
139  // Returns:
140  // ON::curve_object
141  ON::object_type ObjectType() const override;
142 
143  // virtual ON_Geometry GetTightBoundingBox override
144  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
145 
146  /*
147  Description:
148  overrides virtual ON_Geometry::Transform().
149  ON_Curve::Transform() calls ON_Geometry::Transform(xform),
150  which calls ON_Object::TransformUserData(xform), and then
151  calls this->DestroyCurveTree().
152  Parameters:
153  xform - [in] transformation to apply to object.
154  Remarks:
155  Classes derived from ON_Curve should call
156  ON_Curve::Transform() to handle user data
157  transformations and curve tree destruction
158  and then transform their definition.
159  */
160  bool Transform(
161  const ON_Xform& xform
162  ) override;
163 
164 
165  ////////////////////////////////////////////////////////////////////
166  // curve interface
167 
168  // Description:
169  // Gets domain of the curve
170  // Parameters:
171  // t0 - [out]
172  // t1 - [out] domain is [*t0, *t1]
173  // Returns:
174  // true if successful.
175  bool GetDomain( double* t0, double* t1 ) const;
176 
177  // Returns:
178  // domain of the curve.
179  virtual
180  ON_Interval Domain() const = 0;
181 
182  /*
183  Description:
184  Set the domain of the curve.
185  Parameters:
186  domain - [in] increasing interval
187  Returns:
188  true if successful.
189  */
190  bool SetDomain( ON_Interval domain );
191 
192  // Description:
193  // Set the domain of the curve
194  // Parameters:
195  // t0 - [in]
196  // t1 - [in] new domain will be [t0,t1]
197  // Returns:
198  // true if successful.
199  virtual
200  bool SetDomain(
201  double t0,
202  double t1
203  );
204 
205 
206  /*
207  Description:
208  If this curve is closed, then modify it so that
209  the start/end point is at curve parameter t.
210  Parameters:
211  t - [in] curve parameter of new start/end point. The
212  returned curves domain will start at t.
213  Returns:
214  true if successful.
215  */
216  virtual
217  bool ChangeClosedCurveSeam(
218  double t
219  );
220 
221  /*
222  Description:
223  Change the dimension of a curve.
224  Parameters:
225  desired_dimension - [in]
226  Returns:
227  true if the curve's dimension was already desired_dimension
228  or if the curve's dimension was successfully changed to
229  desired_dimension.
230  */
231  virtual
232  bool ChangeDimension(
233  int desired_dimension
234  );
235 
236 
237  // Description:
238  // Get number of nonempty smooth (c-infinity) spans in curve
239  // Returns:
240  // Number of nonempty smooth (c-infinity) spans.
241  virtual
242  int SpanCount() const = 0;
243 
244  // Description:
245  // Get number of parameters of "knots".
246  // Parameters:
247  // knots - [out] an array of length SpanCount()+1 is filled in
248  // with the parameters where the curve is not smooth (C-infinity).
249  // Returns:
250  // true if successful
251  virtual
252  bool GetSpanVector(
253  double* knots
254  ) const = 0; //
255 
256  //////////
257  // If t is in the domain of the curve, GetSpanVectorIndex() returns the
258  // span vector index "i" such that span_vector[i] <= t <= span_vector[i+1].
259  // The "side" parameter determines which span is selected when t is at the
260  // end of a span.
261  virtual
262  bool GetSpanVectorIndex(
263  double t , // [IN] t = evaluation parameter
264  int side, // [IN] side 0 = default, -1 = from below, +1 = from above
265  int* span_vector_index, // [OUT] span vector index
266  ON_Interval* span_domain // [OUT] domain of the span containing "t"
267  ) const;
268 
269  // Description:
270  // Returns maximum algebraic degree of any span
271  // or a good estimate if curve spans are not algebraic.
272  // Returns:
273  // degree
274  virtual
275  int Degree() const = 0;
276 
277  // Description:
278  // Returns maximum algebraic degree of any span
279  // or a good estimate if curve spans are not algebraic.
280  // Returns:
281  // degree
282  virtual
283  bool GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
284  double t, // [IN] t = parameter in domain
285  double* tminus, // [OUT] tminus
286  double* tplus // [OUT] tplus
287  ) const;
288 
289  // Description:
290  // Test a curve to see if the locus if its points is a line segment.
291  // Parameters:
292  // tolerance - [in] // tolerance to use when checking linearity
293  // Returns:
294  // true if the ends of the curve are farther than tolerance apart
295  // and the maximum distance from any point on the curve to
296  // the line segment connecting the curve's ends is <= tolerance.
297  virtual
298  bool IsLinear(
299  double tolerance = ON_ZERO_TOLERANCE
300  ) const;
301 
302  /*
303  Description:
304  Several types of ON_Curve can have the form of a polyline including
305  a degree 1 ON_NurbsCurve, an ON_PolylineCurve, and an ON_PolyCurve
306  all of whose segments are some form of polyline. IsPolyline tests
307  a curve to see if it can be represented as a polyline.
308  Parameters:
309  pline_points - [out] if not nullptr and true is returned, then the
310  points of the polyline form are returned here.
311  t - [out] if not nullptr and true is returned, then the parameters of
312  the polyline points are returned here.
313  Returns:
314  @untitled table
315  0 curve is not some form of a polyline
316  >=2 number of points in polyline form
317  */
318  virtual
319  int IsPolyline(
320  ON_SimpleArray<ON_3dPoint>* pline_points = nullptr,
321  ON_SimpleArray<double>* pline_t = nullptr
322  ) const;
323 
324  // Description:
325  // Test a curve to see if the locus if its points is an arc or circle.
326  // Parameters:
327  // plane - [in] if not nullptr, test is performed in this plane
328  // arc - [out] if not nullptr and true is returned, then arc parameters
329  // are filled in
330  // tolerance - [in] tolerance to use when checking
331  // Returns:
332  // ON_Arc.m_angle > 0 if curve locus is an arc between
333  // specified points. If ON_Arc.m_angle is 2.0*ON_PI, then the curve
334  // is a circle.
335  virtual
336  bool IsArc(
337  const ON_Plane* plane = nullptr,
338  ON_Arc* arc = nullptr,
339  double tolerance = ON_ZERO_TOLERANCE
340  ) const;
341 
342  /*
343  Description:
344  Parameters:
345  t - [in] curve parameter
346  plane - [in]
347  if not nullptr, test is performed in this plane
348  arc - [out]
349  if not nullptr and true is returned, then arc parameters
350  are filled in
351  tolerance - [in]
352  tolerance to use when checking
353  t0 - [out]
354  if not nullptr, and then *t0 is set to the parameter
355  at the start of the G2 curve segment that was
356  tested.
357  t1 - [out]
358  if not nullptr, and then *t0 is set to the parameter
359  at the start of the G2 curve segment that was
360  tested.
361  Returns:
362  True if the paramter t is on a arc segment of the curve.
363  */
364  bool IsArcAt(
365  double t,
366  const ON_Plane* plane = 0,
367  ON_Arc* arc = 0,
368  double tolerance = ON_ZERO_TOLERANCE,
369  double* t0 = 0,
370  double* t1 = 0
371  ) const;
372 
373  virtual
374  bool IsEllipse(
375  const ON_Plane* plane = nullptr,
376  ON_Ellipse* ellipse = nullptr,
377  double tolerance = ON_ZERO_TOLERANCE
378  ) const;
379 
380  // Description:
381  // Test a curve to see if it is planar.
382  // Parameters:
383  // plane - [out] if not nullptr and true is returned,
384  // the plane parameters are filled in.
385  // tolerance - [in] tolerance to use when checking
386  // Returns:
387  // true if there is a plane such that the maximum distance from
388  // the curve to the plane is <= tolerance.
389  virtual
390  bool IsPlanar(
391  ON_Plane* plane = nullptr,
392  double tolerance = ON_ZERO_TOLERANCE
393  ) const;
394 
395  // Description:
396  // Test a curve to see if it lies in a specific plane.
397  // Parameters:
398  // test_plane - [in]
399  // tolerance - [in] tolerance to use when checking
400  // Returns:
401  // true if the maximum distance from the curve to the
402  // test_plane is <= tolerance.
403  virtual
404  bool IsInPlane(
405  const ON_Plane& test_plane,
406  double tolerance = ON_ZERO_TOLERANCE
407  ) const = 0;
408 
409  /*
410  Description:
411  Decide if it makes sense to close off this curve by moving
412  the endpoint to the start based on start-end gap size and length
413  of curve as approximated by chord defined by 6 points.
414  Parameters:
415  tolerance - [in] maximum allowable distance between start and end.
416  if start - end gap is greater than tolerance, returns false
417  min_abs_size - [in] if greater than 0.0 and none of the interior sampled
418  points are at least min_abs_size from start, returns false.
419  min_rel_size - [in] if greater than 1.0 and chord length is less than
420  min_rel_size*gap, returns false.
421  Returns:
422  true if start and end points are close enough based on above conditions.
423  */
424 
425  bool IsClosable(
426  double tolerance,
427  double min_abs_size = 0.0,
428  double min_rel_size = 10.0
429  ) const;
430 
431  // Description:
432  // Test a curve to see if it is closed.
433  // Returns:
434  // true if the curve is closed.
435  virtual
436  bool IsClosed() const;
437 
438  // Description:
439  // Test a curve to see if it is periodic.
440  // Returns:
441  // true if the curve is closed and at least C2 at the start/end.
442  virtual
443  bool IsPeriodic() const;
444 
445  /*
446  Description:
447  Search for a derivatitive, tangent, or curvature
448  discontinuity.
449  Parameters:
450  c - [in] type of continity to test for.
451  t0 - [in] Search begins at t0. If there is a discontinuity
452  at t0, it will be ignored. This makes it
453  possible to repeatedly call GetNextDiscontinuity
454  and step through the discontinuities.
455  t1 - [in] (t0 != t1) If there is a discontinuity at t1 is
456  will be ingored unless c is a locus discontinuity
457  type and t1 is at the start or end of the curve.
458  t - [out] if a discontinuity is found, then *t reports the
459  parameter at the discontinuity.
460  hint - [in/out] if GetNextDiscontinuity will be called
461  repeatedly, passing a "hint" with initial value *hint=0
462  will increase the speed of the search.
463  dtype - [out] if not nullptr, *dtype reports the kind of
464  discontinuity found at *t. A value of 1 means the first
465  derivative or unit tangent was discontinuous. A value
466  of 2 means the second derivative or curvature was
467  discontinuous. A value of 0 means teh curve is not
468  closed, a locus discontinuity test was applied, and
469  t1 is at the start of end of the curve.
470  If 'c', the type of continuity to test for
471  is ON::continuity::Gsmooth_continuous and the curvature changes
472  from curved to 0 or 0 to curved and there is no
473  tangency kink dtype is returns 3
474  cos_angle_tolerance - [in] default = cos(1 degree) Used only
475  when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the
476  cosine of the angle between two tangent vectors is
477  <= cos_angle_tolerance, then a G1 discontinuity is reported.
478  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used
479  only when c is ON::continuity::G2_continuous. If K0 and K1 are
480  curvatures evaluated from above and below and
481  |K0 - K1| > curvature_tolerance, then a curvature
482  discontinuity is reported.
483  Returns:
484  Parametric continuity tests c = (C0_continuous, ..., G2_continuous):
485 
486  true if a parametric discontinuity was found strictly
487  between t0 and t1. Note well that all curves are
488  parametrically continuous at the ends of their domains.
489 
490  Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):
491 
492  true if a locus discontinuity was found strictly between
493  t0 and t1 or at t1 is the at the end of a curve.
494  Note well that all open curves (IsClosed()=false) are locus
495  discontinuous at the ends of their domains. All closed
496  curves (IsClosed()=true) are at least C0_locus_continuous at
497  the ends of their domains.
498  */
499  virtual
500  bool GetNextDiscontinuity(
501  ON::continuity c,
502  double t0,
503  double t1,
504  double* t,
505  int* hint=nullptr,
506  int* dtype=nullptr,
507  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
508  double curvature_tolerance=ON_SQRT_EPSILON
509  ) const;
510 
511  /*
512  Description:
513  Test continuity at a curve parameter value.
514  Parameters:
515  c - [in] type of continuity to test for. Read ON::continuity
516  comments for details.
517  t - [in] parameter to test
518  hint - [in] evaluation hint
519  point_tolerance - [in] if the distance between two points is
520  greater than point_tolerance, then the curve is not C0.
521  d1_tolerance - [in] if the difference between two first derivatives is
522  greater than d1_tolerance, then the curve is not C1.
523  d2_tolerance - [in] if the difference between two second derivatives is
524  greater than d2_tolerance, then the curve is not C2.
525  cos_angle_tolerance - [in] default = cos(1 degree) Used only when
526  c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine
527  of the angle between two tangent vectors
528  is <= cos_angle_tolerance, then a G1 discontinuity is reported.
529  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when
530  c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
531  ON::continuity::G2_continuous:
532  If K0 and K1 are curvatures evaluated
533  from above and below and |K0 - K1| > curvature_tolerance,
534  then a curvature discontinuity is reported.
535  ON::continuity::Gsmooth_continuous:
536  If K0 and K1 are curvatures evaluated from above and below
537  and the angle between K0 and K1 is at least twice angle tolerance
538  or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance,
539  then a curvature discontinuity is reported.
540  Returns:
541  true if the curve has at least the c type continuity at
542  the parameter t.
543  */
544  virtual
545  bool IsContinuous(
546  ON::continuity c,
547  double t,
548  int* hint = nullptr,
549  double point_tolerance=ON_ZERO_TOLERANCE,
550  double d1_tolerance=ON_ZERO_TOLERANCE,
551  double d2_tolerance=ON_ZERO_TOLERANCE,
552  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
553  double curvature_tolerance=ON_SQRT_EPSILON
554  ) const;
555 
556 
557  // Description:
558  // Reverse the direction of the curve.
559  // Returns:
560  // true if curve was reversed.
561  // Remarks:
562  // If reveresed, the domain changes from [a,b] to [-b,-a]
563  virtual
564  bool Reverse()=0;
565 
566 
567  /*
568  Description:
569  Force the curve to start at a specified point.
570  Parameters:
571  start_point - [in]
572  Returns:
573  true if successful.
574  Remarks:
575  Some end points cannot be moved. Be sure to check return
576  code.
577  ON_Curve::SetStartPoint() returns true if start_point is the same as the start of the curve,
578  false otherwise.
579  See Also:
580  ON_Curve::SetEndPoint
581  ON_Curve::PointAtStart
582  ON_Curve::PointAtEnd
583  */
584  virtual
585  bool SetStartPoint(
586  ON_3dPoint start_point
587  );
588 
589  /*
590  Description:
591  Force the curve to end at a specified point.
592  Parameters:
593  end_point - [in]
594  Returns:
595  true if successful.
596  Remarks:
597  Some end points cannot be moved. Be sure to check return
598  code.
599  ON_Curve::SetEndPoint() returns true if end_point is the same as the end of the curve,
600  false otherwise.
601  See Also:
602  ON_Curve::SetStartPoint
603  ON_Curve::PointAtStart
604  ON_Curve::PointAtEnd
605  */
606  virtual
607  bool SetEndPoint(
608  ON_3dPoint end_point
609  );
610 
611  // Description:
612  // Evaluate point at a parameter.
613  // Parameters:
614  // t - [in] evaluation parameter
615  // Returns:
616  // Point (location of curve at the parameter t).
617  // Remarks:
618  // No error handling.
619  // See Also:
620  // ON_Curve::EvPoint
621  // ON_Curve::PointAtStart
622  // ON_Curve::PointAtEnd
623  ON_3dPoint PointAt(
624  double t
625  ) const;
626 
627  // Description:
628  // Evaluate point at the start of the curve.
629  // Parameters:
630  // t - [in] evaluation parameter
631  // Returns:
632  // Point (location of the start of the curve.)
633  // Remarks:
634  // No error handling.
635  // See Also:
636  // ON_Curve::PointAt
637  ON_3dPoint PointAtStart() const;
638 
639  // Description:
640  // Evaluate point at the end of the curve.
641  // Parameters:
642  // t - [in] evaluation parameter
643  // Returns:
644  // Point (location of the end of the curve.)
645  // Remarks:
646  // No error handling.
647  // See Also:
648  // ON_Curve::PointAt
649  ON_3dPoint PointAtEnd() const;
650 
651  // Description:
652  // Evaluate first derivative at a parameter.
653  // Parameters:
654  // t - [in] evaluation parameter
655  // Returns:
656  // First derivative of the curve at the parameter t.
657  // Remarks:
658  // No error handling.
659  // See Also:
660  // ON_Curve::Ev1Der
661  ON_3dVector DerivativeAt(
662  double t
663  ) const;
664 
665  // Description:
666  // Evaluate unit tangent vector at a parameter.
667  // Parameters:
668  // t - [in] evaluation parameter
669  // Returns:
670  // Unit tangent vector of the curve at the parameter t.
671  // Remarks:
672  // No error handling.
673  // See Also:
674  // ON_Curve::EvTangent
675  ON_3dVector TangentAt(
676  double t
677  ) const;
678 
679  // Description:
680  // Evaluate the curvature vector at a parameter.
681  // Parameters:
682  // t - [in] evaluation parameter
683  // Returns:
684  // curvature vector of the curve at the parameter t.
685  // Remarks:
686  // No error handling.
687  // See Also:
688  // ON_Curve::EvCurvature
689  ON_3dVector CurvatureAt(
690  double t
691  ) const;
692 
693  // Description:
694  // Return a 3d frame at a parameter.
695  // Parameters:
696  // t - [in] evaluation parameter
697  // plane - [out] the frame is returned here
698  // Returns:
699  // true if successful
700  // See Also:
701  // ON_Curve::PointAt, ON_Curve::TangentAt,
702  // ON_Curve::Ev1Der, Ev2Der
703  bool FrameAt( double t, ON_Plane& plane) const;
704 
705  // Description:
706  // Evaluate point at a parameter with error checking.
707  // Parameters:
708  // t - [in] evaluation parameter
709  // point - [out] value of curve at t
710  // side - [in] optional - determines which side to evaluate from
711  // =0 default
712  // <0 to evaluate from below,
713  // >0 to evaluate from above
714  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
715  // Returns:
716  // false if unable to evaluate.
717  // See Also:
718  // ON_Curve::PointAt
719  // ON_Curve::EvTangent
720  // ON_Curve::Evaluate
721  bool EvPoint(
722  double t,
723  ON_3dPoint& point,
724  int side = 0,
725  int* hint = 0
726  ) const;
727 
728  // Description:
729  // Evaluate first derivative at a parameter with error checking.
730  // Parameters:
731  // t - [in] evaluation parameter
732  // point - [out] value of curve at t
733  // first_derivative - [out] value of first derivative at t
734  // side - [in] optional - determines which side to evaluate from
735  // =0 default
736  // <0 to evaluate from below,
737  // >0 to evaluate from above
738  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
739  // Returns:
740  // false if unable to evaluate.
741  // See Also:
742  // ON_Curve::EvPoint
743  // ON_Curve::Ev2Der
744  // ON_Curve::EvTangent
745  // ON_Curve::Evaluate
746  bool Ev1Der(
747  double t,
748  ON_3dPoint& point,
749  ON_3dVector& first_derivative,
750  int side = 0,
751  int* hint = 0
752  ) const;
753 
754  // Description:
755  // Evaluate second derivative at a parameter with error checking.
756  // Parameters:
757  // t - [in] evaluation parameter
758  // point - [out] value of curve at t
759  // first_derivative - [out] value of first derivative at t
760  // second_derivative - [out] value of second derivative at t
761  // side - [in] optional - determines which side to evaluate from
762  // =0 default
763  // <0 to evaluate from below,
764  // >0 to evaluate from above
765  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
766  // Returns:
767  // false if unable to evaluate.
768  // See Also:
769  // ON_Curve::Ev1Der
770  // ON_Curve::EvCurvature
771  // ON_Curve::Evaluate
772  bool Ev2Der(
773  double t,
774  ON_3dPoint& point,
775  ON_3dVector& first_derivative,
776  ON_3dVector& second_derivative,
777  int side = 0,
778  int* hint = 0
779  ) const;
780 
781  /*
782  Description:
783  Evaluate unit tangent at a parameter with error checking.
784  Parameters:
785  t - [in] evaluation parameter
786  point - [out] value of curve at t
787  tangent - [out] value of unit tangent
788  side - [in] optional - determines which side to evaluate from
789  =0 default
790  <0 to evaluate from below,
791  >0 to evaluate from above
792  hint - [in/out] optional evaluation hint used to speed repeated evaluations
793  Returns:
794  false if unable to evaluate.
795  See Also:
796  ON_Curve::TangentAt
797  ON_Curve::Ev1Der
798  */
799  bool EvTangent(
800  double t,
801  ON_3dPoint& point,
802  ON_3dVector& tangent,
803  int side = 0,
804  int* hint = 0
805  ) const;
806 
807  /*
808  Description:
809  Evaluate unit tangent and curvature at a parameter with error checking.
810  Parameters:
811  t - [in] evaluation parameter
812  point - [out] value of curve at t
813  tangent - [out] value of unit tangent
814  kappa - [out] value of curvature vector
815  side - [in] optional - determines which side to evaluate from
816  =0 default
817  <0 to evaluate from below,
818  >0 to evaluate from above
819  hint - [in/out] optional evaluation hint used to speed repeated evaluations
820  Returns:
821  false if unable to evaluate.
822  See Also:
823  ON_Curve::CurvatureAt
824  ON_Curve::Ev2Der
825  ON_EvCurvature
826  */
827  bool EvCurvature(
828  double t,
829  ON_3dPoint& point,
830  ON_3dVector& tangent,
831  ON_3dVector& kappa,
832  int side = 0,
833  int* hint = 0
834  ) const;
835 
836  /*
837  Description:
838  This evaluator actually does all the work. The other ON_Curve
839  evaluation tools call this virtual function.
840  Parameters:
841  t - [in] evaluation parameter ( usually in Domain() ).
842  der_count - [in] (>=0) number of derivatives to evaluate
843  v_stride - [in] (>=Dimension()) stride to use for the v[] array
844  v - [out] array of length (der_count+1)*v_stride
845  curve(t) is returned in (v[0],...,v[m_dim-1]),
846  curve'(t) is retuned in (v[v_stride],...,v[v_stride+m_dim-1]),
847  curve"(t) is retuned in (v[2*v_stride],...,v[2*v_stride+m_dim-1]),
848  etc.
849  side - [in] optional - determines which side to evaluate from
850  =0 default
851  <0 to evaluate from below,
852  >0 to evaluate from above
853  hint - [in/out] optional evaluation hint used to speed repeated evaluations
854  Returns:
855  false if unable to evaluate.
856  See Also:
857  ON_Curve::EvPoint
858  ON_Curve::Ev1Der
859  ON_Curve::Ev2Der
860  */
861  virtual
862  bool Evaluate(
863  double t,
864  int der_count,
865  int v_stride,
866  double* v,
867  int side = 0,
868  int* hint = 0
869  ) const = 0;
870 
871 
872 
873  /*
874  Parameters:
875  min_length -[in]
876  minimum length of a linear span
877  tolerance -[in]
878  distance tolerance to use when checking linearity.
879  Returns
880  true if the span is a non-degenrate line. This means:
881  - dimension = 2 or 3
882  - The length of the the line segment from the span's initial
883  point to the span's control point is >= min_length.
884  - The maximum distance from the line segment to the span
885  is <= tolerance and the span increases monotonically
886  in the direction of the line segment.
887  */
888  bool FirstSpanIsLinear(
889  double min_length,
890  double tolerance
891  ) const;
892 
893  bool LastSpanIsLinear(
894  double min_length,
895  double tolerance
896  ) const;
897 
898  bool FirstSpanIsLinear(
899  double min_length,
900  double tolerance,
901  ON_Line* span_line
902  ) const;
903 
904  bool LastSpanIsLinear(
905  double min_length,
906  double tolerance,
907  ON_Line* span_line
908  ) const;
909 
910 
911  // Description:
912  // Removes portions of the curve outside the specified interval.
913  // Parameters:
914  // domain - [in] interval of the curve to keep. Portions of the
915  // curve before curve(domain[0]) and after curve(domain[1]) are
916  // removed.
917  // Returns:
918  // true if successful.
919  virtual
920  bool Trim(
921  const ON_Interval& domain
922  );
923 
924  // Description:
925  // Pure virtual function. Default returns false.
926  // Where possible, analytically extends curve to include domain.
927  // Parameters:
928  // domain - [in] if domain is not included in curve domain,
929  // curve will be extended so that its domain includes domain.
930  // Will not work if curve is closed. Original curve is identical
931  // to the restriction of the resulting curve to the original curve domain,
932  // Returns:
933  // true if successful.
934  virtual
935  bool Extend(
936  const ON_Interval& domain
937  );
938 
939  /*
940  Description:
941  Splits (divides) the curve at the specified parameter.
942  The parameter must be in the interior of the curve's domain.
943  The pointers passed to Split must either be nullptr or point to
944  an ON_Curve object of the same type. If the pointer is nullptr,
945  then a curve will be created in Split(). You may pass "this"
946  as left_side or right_side.
947  Parameters:
948  t - [in] parameter to split the curve at in the
949  interval returned by Domain().
950  left_side - [out] left portion of curve returned here
951  right_side - [out] right portion of curve returned here
952  Returns:
953  true - The curve was split into two pieces.
954  false - The curve could not be split. For example if the parameter is
955  too close to an endpoint.
956 
957  Example:
958  For example, if crv were an ON_NurbsCurve, then
959 
960  ON_NurbsCurve right_side;
961  crv.Split( crv.Domain().Mid() &crv, &right_side );
962 
963  would split crv at the parametric midpoint, put the left side
964  in crv, and return the right side in right_side.
965  */
966  virtual
967  bool Split(
968  double t,
969  ON_Curve*& left_side,
970  ON_Curve*& right_side
971  ) const;
972 
973  /*
974  Description:
975  Get a NURBS curve representation of this curve.
976  Parameters:
977  nurbs_curve - [out] NURBS representation returned here
978  tolerance - [in] tolerance to use when creating NURBS
979  representation.
980  subdomain - [in] if not nullptr, then the NURBS representation
981  for this portion of the curve is returned.
982  Returns:
983  0 unable to create NURBS representation
984  with desired accuracy.
985  1 success - returned NURBS parameterization
986  matches the curve's to wthe desired accuracy
987  2 success - returned NURBS point locus matches
988  the curve's to the desired accuracy and the
989  domain of the NURBS curve is correct. On
990  However, This curve's parameterization and
991  the NURBS curve parameterization may not
992  match to the desired accuracy. This situation
993  happens when getting NURBS representations of
994  curves that have a transendental parameterization
995  like circles
996  Remarks:
997  This is a low-level virtual function. If you do not need
998  the parameterization information provided by the return code,
999  then ON_Curve::NurbsCurve may be easier to use.
1000  See Also:
1001  ON_Curve::NurbsCurve
1002  */
1003  virtual
1004  int GetNurbForm(
1005  ON_NurbsCurve& nurbs_curve,
1006  double tolerance = 0.0,
1007  const ON_Interval* subdomain = nullptr
1008  ) const;
1009  /*
1010  Description:
1011  Does a NURBS curve representation of this curve.
1012  Parameters:
1013  Returns:
1014  0 unable to create NURBS representation
1015  with desired accuracy.
1016  1 success - NURBS parameterization
1017  matches the curve's to wthe desired accuracy
1018  2 success - NURBS point locus matches
1019  the curve's and the
1020  domain of the NURBS curve is correct.
1021  However, This curve's parameterization and
1022  the NURBS curve parameterization may not
1023  match. This situation
1024  happens when getting NURBS representations of
1025  curves that have a transendental parameterization
1026  like circles
1027  Remarks:
1028  This is a low-level virtual function.
1029  See Also:
1030  ON_Curve::GetNurbForm
1031  ON_Curve::NurbsCurve
1032  */
1033  virtual
1034  int HasNurbForm() const;
1035 
1036  /*
1037  Description:
1038  Get a NURBS curve representation of this curve.
1039  Parameters:
1040  pNurbsCurve - [in/out] if not nullptr, this ON_NurbsCurve
1041  will be used to store the NURBS representation
1042  of the curve will be returned.
1043  tolerance - [in] tolerance to use when creating NURBS
1044  representation.
1045  subdomain - [in] if not nullptr, then the NURBS representation
1046  for this portion of the curve is returned.
1047  Returns:
1048  nullptr or a NURBS representation of the curve.
1049  Remarks:
1050  See ON_Surface::GetNurbForm for important details about
1051  the NURBS surface parameterization.
1052  See Also:
1053  ON_Curve::GetNurbForm
1054  */
1055  ON_NurbsCurve* NurbsCurve(
1056  ON_NurbsCurve* pNurbsCurve = nullptr,
1057  double tolerance = 0.0,
1058  const ON_Interval* subdomain = nullptr
1059  ) const;
1060 
1061  // Description:
1062  // Convert a NURBS curve parameter to a curve parameter
1063  //
1064  // Parameters:
1065  // nurbs_t - [in] nurbs form parameter
1066  // curve_t - [out] curve parameter
1067  //
1068  // Remarks:
1069  // If GetNurbForm returns 2, this function converts the curve
1070  // parameter to the NURBS curve parameter.
1071  //
1072  // See Also:
1073  // ON_Curve::GetNurbForm, ON_Curve::GetNurbFormParameterFromCurveParameter
1074  virtual
1075  bool GetCurveParameterFromNurbFormParameter(
1076  double nurbs_t,
1077  double* curve_t
1078  ) const;
1079 
1080  // Description:
1081  // Convert a curve parameter to a NURBS curve parameter.
1082  //
1083  // Parameters:
1084  // curve_t - [in] curve parameter
1085  // nurbs_t - [out] nurbs form parameter
1086  //
1087  // Remarks:
1088  // If GetNurbForm returns 2, this function converts the curve
1089  // parameter to the NURBS curve parameter.
1090  //
1091  // See Also:
1092  // ON_Curve::GetNurbForm, ON_Curve::GetCurveParameterFromNurbFormParameter
1093  virtual
1094  bool GetNurbFormParameterFromCurveParameter(
1095  double curve_t,
1096  double* nurbs_t
1097  ) const;
1098 
1099 
1100  // Description:
1101  // Destroys the runtime curve tree used to speed closest
1102  // point and intersection calcuations.
1103  // Remarks:
1104  // If the geometry of the curve is modified in any way,
1105  // then call DestroyCurveTree(); The curve tree is
1106  // created as needed.
1107  void DestroyCurveTree();
1108 
1109 
1110  /*
1111  Description:
1112  Lookup a parameter in the m_t array, optionally using a built in snap tolerance to
1113  snap a parameter value to an element of m_t.
1114  This function is used by some types derived from ON_Curve to snap parameter values
1115  Parameters:
1116  t - [in] parameter
1117  index -[out] index into m_t such that
1118  if function returns false then
1119 
1120  @table
1121  value condition
1122  -1 t<m_t[0] or m_t is empty
1123  0<=i<=m_t.Count()-2 m_t[i] < t < m_t[i+1]
1124  m_t.Count()-1 t>m_t[ m_t.Count()-1]
1125 
1126  if the function returns true then t is equal to, or is closest to and
1127  within tolerance of m_t[index].
1128 
1129  bEnableSnap-[in] enable snapping
1130  m_t -[in] Array of parameter values to snap to
1131  RelTol -[in] tolerance used in snapping
1132 
1133  Returns:
1134  true if the t is exactly equal to (bEnableSnap==false), or within tolerance of
1135  (bEnableSnap==true) m_t[index].
1136  */
1137 protected:
1138  bool ParameterSearch( double t, int& index, bool bEnableSnap, const ON_SimpleArray<double>& m_t,
1139  double RelTol=ON_SQRT_EPSILON) const;
1140 
1141 private:
1142 };
1143 
1144 #if defined(ON_DLL_TEMPLATE)
1145 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Curve*>;
1146 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Curve*>;
1147 #endif
1148 
1149 class ON_CLASS ON_CurveArray : public ON_SimpleArray<ON_Curve*>
1150 {
1151 public:
1152  ON_CurveArray( int = 0 );
1153  ~ON_CurveArray(); // deletes any non-nullptr curves
1154 
1155  bool Write( ON_BinaryArchive& ) const;
1156  bool Read( ON_BinaryArchive& );
1157 
1158  void Destroy(); // deletes curves, sets pointers to nullptr, sets count to zero
1159 
1160  bool Duplicate( ON_CurveArray& ) const; // operator= copies the pointer values
1161  // duplicate copies the curves themselves
1162 
1163  /*
1164  Description:
1165  Get tight bounding box of the bezier.
1166  Parameters:
1167  tight_bbox - [in/out] tight bounding box
1168  bGrowBox -[in] (default=false)
1169  If true and the input tight_bbox is valid, then returned
1170  tight_bbox is the union of the input tight_bbox and the
1171  tight bounding box of the bezier curve.
1172  xform -[in] (default=nullptr)
1173  If not nullptr, the tight bounding box of the transformed
1174  bezier is calculated. The bezier curve is not modified.
1175  Returns:
1176  True if the returned tight_bbox is set to a valid
1177  bounding box.
1178  */
1179  bool GetTightBoundingBox(
1180  ON_BoundingBox& tight_bbox,
1181  bool bGrowBox = false,
1182  const ON_Xform* xform = nullptr
1183  ) const;
1184 };
1185 
1186 /*
1187 Description:
1188  Trim a curve.
1189 Parameters:
1190  curve - [in] curve to trim (not modified)
1191  trim_parameters - [in] trimming parameters
1192  If curve is open, then trim_parameters must be an increasing
1193  interval.If curve is closed, and trim_parameters ins a
1194  decreasing interval, then the portion of the curve across the
1195  start/end is returned.
1196 Returns:
1197  trimmed curve or nullptr if input is invalid.
1198 */
1199 ON_DECL
1200 ON_Curve* ON_TrimCurve(
1201  const ON_Curve& curve,
1202  ON_Interval trim_parameters
1203  );
1204 
1205 /*
1206 Description:
1207  Move ends of curves to a common point. Neither curve can be closed or an ON_CurveProxy.
1208  If one is an arc or polycurve with arc at end to change, and the other is not,
1209  then the arc is left unchanged and the other curve is moved to the arc endpoint.
1210  Otherwise, both are moved to the midpoint of the segment between the ends.
1211 Parameters:
1212  Crv0 - [in] first curve to modify.
1213  [out] with one endpoint possibly changed.
1214  end0 - [in] if 0, change start of Crv0. Otherwise change end.
1215  Crv1 - [in] second curve to modify.
1216  [out] with one endpoint possibly changed.
1217  end1 - [in] if 0, change start of Crv1. Otherwise change end.
1218 Returns:
1219  true if the endpoints match. Falsse otherwise,
1220 */
1221 ON_DECL
1222 bool ON_ForceMatchCurveEnds(
1223  ON_Curve& Crv0,
1224  int end0,
1225  ON_Curve& Crv1,
1226  int end1
1227  );
1228 
1229 /*
1230 OBSOLETE. Use int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
1231  ON_SimpleArray<ON_Curve*>& OutCurves,
1232  double join_tol,
1233  double kink_tol,
1234  bool bPreserveDirection = false,
1235  ON_SimpleArray<int>* key = 0
1236  );
1237 
1238 Description:
1239  Join all contiguous curves of an array of ON_Curves.
1240 Parameters:
1241  InCurves - [in] Array of curves to be joined (not modified)
1242  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
1243  are appended.
1244  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
1245  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
1246  If false, all start and endpoints will be compared, and copies of input
1247  curves may be reversed in output.
1248  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
1249 Returns:
1250  Number of curves added to Outcurves
1251 Remarks:
1252  Closed curves are copied to OutCurves.
1253  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
1254  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
1255  */
1256 ON_DECL
1257 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
1258  ON_SimpleArray<ON_Curve*>& OutCurves,
1259  double join_tol,
1260  bool bPreserveDirection = false,
1261  ON_SimpleArray<int>* key = 0
1262  );
1263 
1264 /*
1265 Description:
1266  Join all contiguous curves of an array of ON_Curves.
1267 Parameters:
1268  InCurves - [in] Array of curves to be joined (not modified)
1269  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
1270  are appended.
1271  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
1272  kink_tol - [in] Angle in radians. If > 0.0, then curves within join_tol will only be joined if the angle between them
1273  is less than kink_tol. If <= 0, then the angle will be ignored and only join_tol will be used.
1274  bUseTanAngle - [in] If true, choose the best match using angle between tangents.
1275  If false, best match is the closest. This is used whether or not kink_tol is positive.
1276  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
1277  If false, all start and endpoints will be compared, and copies of input
1278  curves may be reversed in output.
1279  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
1280 Returns:
1281  Number of curves added to Outcurves
1282 Remarks:
1283  Closed curves are copied to OutCurves.
1284  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
1285  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
1286  */
1287 ON_DECL
1288 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
1289  ON_SimpleArray<ON_Curve*>& OutCurves,
1290  double join_tol,
1291  double kink_tol,
1292  bool bUseTanAngle,
1293  bool bPreserveDirection = false,
1294  ON_SimpleArray<int>* key = 0
1295  );
1296 
1297 
1298 /*
1299 Description:
1300  Sort a list of lines so they are geometrically continuous.
1301 Parameters:
1302  line_count - [in] number of lines
1303  line_list - [in] array of lines
1304  index - [out] The input index[] is an array of line_count unused integers.
1305  The returned index[] is a permutation of {0,1,...,line_count-1}
1306  so that the list of lines is in end-to-end order.
1307  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
1308  If the returned value of bReverse[j] is true, then
1309  line_list[index[j]] needs to be reversed.
1310 Returns:
1311  True if successful, false if not.
1312 */
1313 ON_DECL
1314 bool ON_SortLines(
1315  int line_count,
1316  const ON_Line* line_list,
1317  int* index,
1318  bool* bReverse
1319  );
1320 
1321 /*
1322 Description:
1323  Sort a list of lines so they are geometrically continuous.
1324 Parameters:
1325  line_list - [in] array of lines
1326  index - [out] The input index[] is an array of line_count unused integers.
1327  The returned index[] is a permutation of {0,1,...,line_count-1}
1328  so that the list of lines is in end-to-end order.
1329  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
1330  If the returned value of bReverse[j] is true, then
1331  line_list[index[j]] needs to be reversed.
1332 Returns:
1333  True if successful, false if not.
1334 */
1335 ON_DECL
1336 bool ON_SortLines(
1337  const ON_SimpleArray<ON_Line>& line_list,
1338  int* index,
1339  bool* bReverse
1340  );
1341 
1342 /*
1343 Description:
1344  Sort a list of open curves so end of a curve matches the start of the next curve.
1345 Parameters:
1346  curve_count - [in] number of curves
1347  curve_list - [in] array of curve pointers
1348  index - [out] The input index[] is an array of curve_count unused integers.
1349  The returned index[] is a permutation of {0,1,...,curve_count-1}
1350  so that the list of curves is in end-to-end order.
1351  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
1352  If the returned value of bReverse[j] is true, then
1353  curve_list[index[j]] needs to be reversed.
1354 Returns:
1355  True if successful, false if not.
1356 */
1357 ON_DECL
1358 bool ON_SortCurves(
1359  int curve_count,
1360  const ON_Curve* const* curve_list,
1361  int* index,
1362  bool* bReverse
1363  );
1364 
1365 /*
1366 Description:
1367  Sort a list of curves so end of a curve matches the start of the next curve.
1368 Parameters:
1369  curve - [in] array of curves to sort. The curves themselves are not modified.
1370  index - [out] The input index[] is an array of curve_count unused integers.
1371  The returned index[] is a permutation of {0,1,...,curve_count-1}
1372  so that the list of curves is in end-to-end order.
1373  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
1374  If the returned value of bReverse[j] is true, then
1375  curve[index[j]] needs to be reversed.
1376 Returns:
1377  True if successful, false if not.
1378 */
1379 ON_DECL
1380 bool ON_SortCurves(
1381  const ON_SimpleArray<const ON_Curve*>& curves,
1382  ON_SimpleArray<int>& index,
1383  ON_SimpleArray<bool>& bReverse
1384  );
1385 
1386 /*
1387 Description:
1388  Sort a list of curves so end of a curve matches the start of the next curve.
1389 Parameters:
1390  curve_count - [in] number of curves
1391  curve - [in] array of curve pointers
1392  index - [out] The input index[] is an array of curve_count unused integers.
1393  The returned index[] is a permutation of {0,1,...,curve_count-1}
1394  so that the list of curves is in end-to-end order.
1395  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
1396  If the returned value of bReverse[j] is true, then
1397  curve[index[j]] needs to be reversed.
1398 Returns:
1399  True if successful, false if not.
1400 */
1401 ON_DECL
1402 bool ON_SortCurves(
1403  const ON_SimpleArray<ON_Curve*>& curves,
1404  ON_SimpleArray<int>& index,
1405  ON_SimpleArray<bool>& bReverse
1406  );
1407 
1408 /*
1409 Description:
1410  Determine the orientaion (counterclockwise or clockwise) of a closed
1411  planar curve.
1412 Paramters:
1413  curve - [in] simple (no self intersections) closed planar curve
1414  xform - [in] Transformation to map the curve to the xy plane. If the
1415  curve is parallel to the xy plane, you may pass nullptr.
1416 Returns:
1417  +1: The curve's orientation is counter clockwise in the xy plane.
1418  -1: The curve's orientation is clockwise in the xy plane.
1419  0: Unable to compute the curve's orientation.
1420 */
1421 ON_DECL
1422 int ON_ClosedCurveOrientation( const ON_Curve& curve, const ON_Xform* xform );
1423 
1424 
1425 /*
1426 Description:
1427  Get a crude aproximation of the signed area of the region in the
1428  x-y plane traced out by the curve. This is useful for calculating
1429  the orientation of projections of loops to planes when you have
1430  more than one curve.
1431 Paramters:
1432  curve - [in]
1433  domain - [in]
1434  optional sub-domain. (null if entire curve should be used).
1435  xform - [in] Transformation to map the curve to the xy plane. If the
1436  curve is parallel to the xy plane, you may pass nullptr.
1437  bReverseCurve - [in]
1438 Returns:
1439  1/2 the sum of (p[i].x-p[i+1].x)*(p[i].y+p[i+1].y), where p[i]
1440  is a series of sampled points on the curve.
1441 */
1442 ON_DECL
1443 double ON_CurveOrientationArea(
1444  const ON_Curve* curve,
1445  const ON_Interval* domain,
1446  const ON_Xform* xform,
1447  bool bReverseCurve
1448  );
1449 
1450 #endif
virtual bool Transform(const ON_Xform &xform)
Transforms the object.
int m_main_seg_count
Definition: opennurbs_curve.h:42
Definition: opennurbs_curve.h:1168
An ON_Arc is a subcurve of 3d circle.
Definition: opennurbs_arc.h:33
virtual void DestroyRuntimeCache(bool bDelete=true)
Expert user function. If you are using openNURBS in its default configuration to read and write 3dm a...
virtual bool EvaluatePoint(const class ON_ObjRef &objref, ON_3dPoint &P) const
Evaluate the location of a point from the object reference.
double m_max_edge_length
Definition: opennurbs_curve.h:74
ON_Curve is a pure virtual class for curve objects
Definition: opennurbs_curve.h:93
int m_reserved2
Definition: opennurbs_curve.h:46
int m_sub_seg_count
Definition: opennurbs_curve.h:43
double m_max_chr
Definition: opennurbs_curve.h:54
virtual ON::object_type ObjectType() const
Useful for switch statements that need to differentiate between basic object types like points...
Base class for all geometry classes that must provide runtime class id. Provides interface for common...
Definition: opennurbs_geometry.h:37
virtual bool GetTightBoundingBox(class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
Get tight bounding box.
virtual unsigned int SizeOf() const
Definition: opennurbs_bounding_box.h:25
double m_max_aspect
Definition: opennurbs_curve.h:61
double m_reserved4
Definition: opennurbs_curve.h:77
double m_reserved3
Definition: opennurbs_curve.h:76
Definition: opennurbs_curve.h:29
Definition: opennurbs_xform.h:28
double m_tolerance
Definition: opennurbs_curve.h:66
double m_max_ang_radians
Definition: opennurbs_curve.h:50
Definition: opennurbs_line.h:20
int m_reserved1
Definition: opennurbs_curve.h:45
double m_min_edge_length
Definition: opennurbs_curve.h:70
Definition: opennurbs_ellipse.h:23
Definition: opennurbs_nurbscurve.h:26
Definition: opennurbs_archive.h:1783
virtual bool Read(ON_BinaryArchive &binary_archive)
Low level archive writing tool used by ON_BinaryArchive::ReadObject().
Definition: opennurbs_objref.h:163
Definition: opennurbs_point.h:460
virtual bool Write(ON_BinaryArchive &binary_archive) const
Low level archive writing tool used by ON_BinaryArchive::WriteObject().
Definition: opennurbs_plane.h:20
Definition: opennurbs_point.h:1152
Definition: opennurbs_point.h:46