Point Cloud Library (PCL)  1.14.1-dev
opennurbs_beam.h
1 #if !defined(OPENNURBS_EXTRUSION_INC_)
2 #define OPENNURBS_EXTRUSION_INC_
3 
4 /*
5 Description:
6  Get the transformation that maps the ON_Extrusion
7  2d xy profile to 3d world space.
8 Parameters:
9  P - [in] start or end of path
10  T - [in] unit tangent to path
11  U - [in] unit up vector perpendicular to T
12  Normal - [in] optional unit vector with Normal->z > 0 that
13  defines the unit normal to the miter plane.
14  xform - [out]
15  transformation that maps the profile curve to 3d world space
16  scale2d - [out]
17  If not NULL, this is the scale part of the transformation.
18  If there is no mitering, then this is the identity.
19  rot2d - [out]
20  If not null, this is the part of the transformation
21  that rotates the xy plane into its 3d world location.
22 Returns:
23  true if successful.
24 */
25 ON_DECL
26 bool ON_GetEndCapTransformation(
27  ON_3dPoint P,
28  ON_3dVector T,
29  ON_3dVector U,
30  const ON_3dVector* Normal,
31  ON_Xform& xform, // = rot3d*scale2d
32  ON_Xform* scale2d,
33  ON_Xform* rot2d
34  );
35 
36 class ON_CLASS ON_Extrusion : public ON_Surface
37 {
38  ON_OBJECT_DECLARE(ON_Extrusion);
39 public:
43 
45 
46  ////////////////////////////////////////////////////////////
47  //
48  // overrides of virtual ON_Object functions
49  //
50  ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const;
51  void Dump( ON_TextLog& ) const;
52  unsigned int SizeOf() const;
53  ON__UINT32 DataCRC( ON__UINT32 current_remainder ) const;
54  ON_BOOL32 Write( ON_BinaryArchive& binary_archive) const;
55  ON_BOOL32 Read( ON_BinaryArchive& binary_archive );
56  ON::object_type ObjectType() const;
57 
58  ////////////////////////////////////////////////////////////
59  //
60  // overrides of virtual ON_Geometry functions
61  //
62  int Dimension() const;
63  ON_BOOL32 GetBBox(
64  double* boxmin,
65  double* boxmax,
66  int bGrowBox = false
67  ) const;
69  ON_BoundingBox& tight_bbox,
70  int bGrowBox = false,
71  const ON_Xform* xform = 0
72  ) const;
73  ON_BOOL32 Transform(
74  const ON_Xform& xform
75  );
76 
77  /*
78  Description:
79  Build a brep form of the extrusion. The outer profile is always
80  the first face in the brep. If there are inner profiles,
81  additional brep faces are created for each profile. If the
82  outer profile is closed, then end caps are added as the last
83  two faces in the brep.
84  Parameters:
85  brep - [in]
86  If the brep pointer is not null, then the brep form is constructed
87  in brep. If the brep pointer is null, then an ON_Brep is allocated
88  on the heap.
89  Returns:
90  If successful, a pointer to the brep form. If unsuccessful, null.
91  */
93  ON_Brep* brep = NULL
94  ) const;
95 
96  /*
97  Description:
98  Build a brep form of the extrusion. The outer profile is always
99  the first face in the brep. If there are inner profiles,
100  additional brep faces are created for each profile. If the
101  outer profile is closed, then end caps are added as the last
102  two faces in the brep.
103  Parameters:
104  brep - [in]
105  If the brep pointer is not null, then the brep form is constructed
106  in brep. If the brep pointer is null, then an ON_Brep is allocated
107  on the heap.
108  bSmoothFaces - [in]
109  If true and the profiles have kinks, then the faces corresponding
110  to those profiles are split so they will be G1.
111  Returns:
112  If successful, a pointer to the brep form. If unsuccessful, null.
113  */
115  ON_Brep* brep,
116  bool bSmoothFaces
117  ) const;
118 
119  /*
120  Description:
121  Build a sum surface form of the extrusion.
122  Parameters:
123  sum_surface - [in]
124  If the sum_surface pointer is not null, then the sum surface
125  form is constructed in sum_surface. If the sum_surface pointer
126  is null, then an ON_SumSurface is allocated on the heap.
127  Returns:
128  If successful, a pointer to the sum surface form.
129  If unsuccessful, null. In particular, extrusions with
130  mitered ends do not have sum surface forms.
131  */
133  ON_SumSurface* sum_surface
134  ) const;
135 
136  /*
137  Description:
138  Convert a component index that identifies a part of this extrusion
139  to a component index that identifies a part of the brep created
140  by BrepForm(...,false).
141  Parameters:
142  extrusion_ci - [in]
143  extrusion_profile_parameter - [in]
144  brep_form - [in]
145  brep created by ON_Extrusion::BrepForm()
146  brep_ci - [out]
147  Returns:
148  True if successful. False if input is not valid, in which case brep_ci
149  is set by calling ON_COMPONENT_INDEX::UnSet().
150  Remarks:
151  If the wall surfaces have creases, then this function cannot
152  be used to identify brep components created by BrepForm(...,true).
153  */
155  ON_COMPONENT_INDEX extrusion_ci,
156  ON_COMPONENT_INDEX& brep_ci
157  ) const;
158 
160  ON_COMPONENT_INDEX extrusion_ci,
161  double extrusion_profile_parameter,
162  const ON_Brep& brep_form,
163  ON_COMPONENT_INDEX& brep_ci
164  ) const;
165 
166  ////////////////////////////////////////////////////////////
167  //
168  // overrides of virtual ON_Surface functions
169  //
170  ON_BOOL32 SetDomain(
171  int dir,
172  double t0,
173  double t1
174  );
176  int dir
177  ) const;
178  ON_BOOL32 GetSurfaceSize(
179  double* width,
180  double* height
181  ) const;
183  int dir
184  ) const;
185  ON_BOOL32 GetSpanVector(
186  int dir,
187  double* span_vector
188  ) const;
190  int dir,
191  double t,
192  int side,
193  int* span_vector_index,
194  ON_Interval* span_interval
195  ) const;
196  int Degree(
197  int dir
198  ) const;
200  int dir,
201  double t,
202  double* tminus,
203  double* tplus
204  ) const;
206  const ON_Curve& curve,
207  const ON_Interval* curve_domain = NULL
208  ) const;
209  ON_BOOL32 IsPlanar(
210  ON_Plane* plane = NULL,
211  double tolerance = ON_ZERO_TOLERANCE
212  ) const;
213  ON_BOOL32 IsClosed(
214  int
215  ) const;
216  ON_BOOL32 IsPeriodic(
217  int
218  ) const;
220  int dir,
221  ON::continuity c,
222  double t0,
223  double t1,
224  double* t,
225  int* hint=NULL,
226  int* dtype=NULL,
227  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
228  double curvature_tolerance=ON_SQRT_EPSILON
229  ) const;
231  ON::continuity c,
232  double s,
233  double t,
234  int* hint = NULL,
235  double point_tolerance=ON_ZERO_TOLERANCE,
236  double d1_tolerance=ON_ZERO_TOLERANCE,
237  double d2_tolerance=ON_ZERO_TOLERANCE,
238  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
239  double curvature_tolerance=ON_SQRT_EPSILON
240  ) const;
242  const ON_BoundingBox& bbox
243  ) const;
244  ON_BOOL32 Reverse( int dir );
245  ON_BOOL32 Transpose();
246  ON_BOOL32 Evaluate(
247  double u, double v,
248  int num_der,
249  int array_stride,
250  double* der_array,
251  int quadrant = 0,
252  int* hint = 0
253  ) const;
255  int dir,
256  double c
257  ) const;
258 
259  ON_BOOL32 Trim(
260  int dir,
261  const ON_Interval& domain
262  );
263  bool Extend(
264  int dir,
265  const ON_Interval& domain
266  );
267  ON_BOOL32 Split(
268  int dir,
269  double c,
270  ON_Surface*& west_or_south_side,
271  ON_Surface*& east_or_north_side
272  ) const;
273 
275  const ON_3dPoint& P,
276  double* s,
277  double* t,
278  double maximum_distance = 0.0,
279  const ON_Interval* sdomain = 0,
280  const ON_Interval* tdomain = 0
281  ) const;
282 
283  ON_BOOL32 GetLocalClosestPoint( const ON_3dPoint&, // test_point
284  double,double, // seed_parameters
285  double*,double*, // parameters of local closest point returned here
286  const ON_Interval* = NULL, // first parameter sub_domain
287  const ON_Interval* = NULL // second parameter sub_domain
288  ) const;
289 
290  //ON_Surface* Offset(
291  // double offset_distance,
292  // double tolerance,
293  // double* max_deviation = NULL
294  // ) const;
295 
297  ON_NurbsSurface& nurbs_surface,
298  double tolerance = 0.0
299  ) const;
300  int HasNurbForm() const;
302  double nurbs_s, double nurbs_t,
303  double* surface_s, double* surface_t
304  ) const;
306  double surface_s, double surface_t,
307  double* nurbs_s, double* nurbs_t
308  ) const;
309 
310  ////////////////////////////////////////////////////////////
311  //
312  // ON_Extrusion interface
313  //
314  void Destroy();
315 
316  /*
317  Description:
318  Sets m_path to (A,B), m_path_domain to [0,Length(AB)],
319  and m_t to [0,1].
320  Parameters:
321  A - [in] path start
322  B - [in] path end
323  Returns:
324  true A and B are valid, the distance from A to B is larger
325  than ON_ZERO_TOLERANCE, and the path was set.
326  false A or B is not valid or the distance from A to B is
327  at most ON_ZERO_TOLERANCE. In this case nothing is set.
328  Remark:
329  You must also set the up direction to be perpendicular to the path.
330  */
332 
333  /*
334  Description:
335  Sets m_path to (A,B), m_path_domain to [0,Length(AB)],
336  m_t to [0,1], and m_up.
337  Parameters:
338  A - [in] path start
339  B - [in] path end
340  up - [in] up direction
341  If up is a unit vector and perpendicular to the line
342  segment from A to B, then m_up is set to up.
343  Otherwise up will be adjusted so it is perpendicular
344  to the line segment from A to B and unitized.
345  Returns:
346  true A and B are valid, the distance from A to B is larger
347  than ON_ZERO_TOLERANCE, and the path was set.
348  false A or B is not valid, or the distance from A to B is
349  at most ON_ZERO_TOLERANCE, or up is invalid, or up
350  is zero, or up is parallel to the line segment.
351  In this case nothing is set.
352  */
354 
355  /*
356  Description:
357  Get the surface parameter for the path.
358  Returns:
359  0: The first surface parameter corresponds to the path direction.
360  (m_bTransposed = true)
361  1: The second surface parameter corresponds to the path direction.
362  (m_bTransposed = false)
363  Remarks:
364  The default ON_Extrusion constructor sets
365  m_bTransposed = false which corresponds to the 1 = PathParameter().
366  */
367  int PathParameter() const;
368 
372 
373  /*
374  Description:
375  Set miter plane normal.
376  Parameters:
377  N - [in] If ON_UNSET_VECTOR or N is parallel to the z-axis,
378  then the miter plane is the default plane
379  perpendicular to the path.
380  If N is valid and the z coordinate of a unitized
381  N is greater than m_Nz_tol, then the miter plane
382  normal is set.
383  end - [in] 0 = set miter plane at the start of the path.
384  1 = set miter plane at the end of the path.
385  */
387 
388  void GetMiterPlaneNormal(int end, ON_3dVector& N) const;
389 
390  /*
391  Returns:
392  0: not mitered.
393  1: start of path is mitered.
394  2: end of path is mitered.
395  3: start and end are mitered.
396  */
397  int IsMitered() const;
398 
399  /*
400  Returns:
401  True if extrusion object is a capped solid.
402  */
403  bool IsSolid() const;
404 
405  /*
406  Returns:
407  0: no or profile is open
408  1: bottom cap
409  2: top cap
410  3: both ends capped.
411  */
412  int IsCapped() const;
413 
414  /*
415  Returns:
416  0: no caps
417  1: exrusion has either a top cap or a bottom cap
418  2: both ends are capped.
419  See Also:
420  ON_Extrusion::ProfileCount()
421  ON_Extrusion::ProfileSmoothSegmentCount()
422  */
423  int CapCount() const;
424 
425  /*
426  Description:
427  Deprecated function.
428 
429  Use CapCount() to determine how many end caps there are.
430  Use ProfileCount() to determine how many profiles there are.
431  Use ProfileSmoothSegmentCount() to determine how many
432  smooth subsegments are in a profile. Each smooth subsegment
433  becomes a wall face in the brep form.
434 
435  Returns:
436  Number of "faces" the extrusion has.
437  0: extrusion is not valid
438  1: extrusion is not capped
439  2: extrusion has a closed outer profile and one cap
440  3: extrusion has a closed outer profile and two caps
441 
442  Remarks:
443  This function was written before extrusions supported "holes"
444  and before the brep form was divided at profile creases.
445  At this point it simply leads to confusion. See the Description
446  function replacements.
447  */
448  ON_DEPRECATED int FaceCount() const;
449 
450  /*
451  Description:
452  Get the transformation that maps the xy profile curve
453  to its 3d location.
454  Parameters:
455  s - [in] 0.0 = starting profile
456  1.0 = ending profile
457  */
458  bool GetProfileTransformation( double s, ON_Xform& xform ) const;
459 
460  /*
461  Description:
462  Get the the 3d plane containing the profile curve at a
463  normalized path parameter.
464  Parameters:
465  s - [in] 0.0 = starting plane
466  1.0 = ending plane
467  plane - [out]
468  Plane containing profile is returned in plane. If
469  false is returned, then the input value of plane
470  is not changed.
471  Returns:
472  true if plane was set. False if this is invalid and plane
473  could not be set.
474  Remarks:
475  When no mitering is happening, GetPathPlane() and
476  GetProfilePlane() return the same plane.
477  */
478  bool GetProfilePlane( double s, ON_Plane& plane ) const;
479 
480 
481  /*
482  Description:
483  Get the the 3d plane perpendicular to the path at a
484  normalized path parameter.
485  Parameters:
486  s - [in] 0.0 = starting plane
487  1.0 = ending plane
488  plane - [out]
489  Plane is returned here. If
490  false is returned, then the input value of plane
491  is not changed.
492  Returns:
493  true if plane was set. False if this is invalid and plane
494  could not be set.
495  Remarks:
496  When no mitering is happening, GetPathPlane() and
497  GetProfilePlane() return the same plane.
498  */
499  bool GetPathPlane( double s, ON_Plane& plane ) const;
500 
501  /*
502  Description:
503  Set the outer profile of the extrusion.
504  Paramters:
505  outer_profile - [in]
506  curve in the xy plane or a 2d curve.
507  bCap - [in]
508  If outer_profile is a closed curve, then bCap
509  determines if the extrusion has end caps.
510  If outer_profile is an open curve, bCap is ignored.
511  Returns:
512  True if the profile was set. In this case the ON_Extrusion class
513  manages the curve and ~ON_Extrusion will delete it. If the outer
514  profile is closed, then the extrusion may also have inner profiles.
515  If the outer profile is open, the extrusion may not have inner
516  profiles. If the extrusion already has a profile, the set will
517  fail.
518  Remarks:
519  If needed, outer_profile will be converted to a 2d
520  curve. If outer_curve is closed but not correctly oriented,
521  it will reversed so it has a counter-clockwise orientation.
522  */
523  bool SetOuterProfile( ON_Curve* outer_profile, bool bCap );
524 
525  /*
526  Description:
527  Add an inner profile.
528  Paramters:
529  inner_profile - [in]
530  closed curve in the xy plane or a 2d curve.
531  Returns:
532  True if the profile was set. In this case the
533  ON_Extrusion class manages the curve and ~ON_Extrusion will
534  delete it. The extrusion must already have an outer profile.
535  If the extrusion already has a profile, the set will
536  fail.
537  Remarks:
538  If needed, innter_profile will be converted to a 2d
539  curve. If inner_profile is not correctly oriented, it
540  will be reversed so it has a clockwise orientation.
541  */
542  bool AddInnerProfile( ON_Curve* inner_profile );
543 
544  /*
545  Returns:
546  Number of profile curves.
547  See Also:
548  ON_Extrusion::CapCount()
549  ON_Extrusion::ProfileSmoothSegmentCount()
550  */
551  int ProfileCount() const;
552 
553  /*
554  Parameter:
555  profile_index - [in]
556  0 <= profile_index < ProfileCount().
557  The outer profile has index 0.
558  Returns:
559  Number of smooth segments in the profile curve.
560  See Also:
561  ON_Extrusion::CapCount()
562  ON_Extrusion::GetProfileKinkParameters()
563  ON_Extrusion::ProfileCount()
564  */
565  int ProfileSmoothSegmentCount( int profile_index ) const;
566 
567  /*
568  Description:
569  Get the surface parameter for the profile.
570  Returns:
571  0: The first surface parameter corresponds to the profile direction.
572  (m_bTransposed = false)
573  1: The second surface parameter corresponds to the profile direction.
574  (m_bTransposed = true)
575  Remarks:
576  The default ON_Extrusion constructor sets
577  m_bTransposed = false which corresponds to the 0 = ProfileParameter().
578  */
579  int ProfileParameter() const;
580 
581  /*
582  Paramters:
583  profile_index - [in]
584  0 <= profile_index < ProfileCount().
585  The outer profile has index 0.
586  Returns:
587  Pointer to the i-th 2d profile. The ON_Extrusion
588  class manages this curve. Do not delete it
589  and do not use the pointer if the ON_Extrusion
590  class changes.
591  */
592  const ON_Curve* Profile(int profile_index) const;
593 
594  /*
595  Paramters:
596  profile_index - [in]
597  0 <= profile_index < ProfileCount().
598  The outer profile has index 0.
599  s - [in] ( 0.0 <= s <= 1.0 )
600  A relative parameter controling which priofile
601  is returned. s = 0.0 returns the bottom profile
602  and s = 1.0 returns the top profile.
603  Returns:
604  NULL if the input parameters or the ON_Extrusion class is
605  not valid. Otherwise a pointer to a 3d curve for
606  the requested profile. This curve is on the heap and
607  the caller is responsible for deleting this curve.
608  */
609  ON_Curve* Profile3d(int profile_index, double s ) const;
610 
611  /*
612  Paramters:
613  ci - [in]
614  component index identifying a 3d extrusion profile curve.
615  Returns:
616  NULL if the component index or the ON_Extrusion class is
617  not valid. Otherwise a pointer to a 3d curve for
618  the requested profile. This curve is on the heap and
619  the caller is responsible for deleting this curve.
620  */
621  ON_Curve* Profile3d( ON_COMPONENT_INDEX ci ) const;
622 
623  /*
624  Paramters:
625  ci - [in]
626  component index identifying a wall edge curve.
627  Returns:
628  NULL if the component index or the ON_Extrusion class is
629  not valid. Otherwise a pointer to a 3d curve for
630  the requested wall edge. This curve is on the heap and
631  the caller is responsible for deleting this curve.
632  */
633  ON_Curve* WallEdge( ON_COMPONENT_INDEX ci ) const;
634 
635  /*
636  Paramters:
637  ci - [in]
638  component index identifying a wall surface.
639  Returns:
640  NULL if the component index or the ON_Extrusion class is
641  not valid. Otherwise a pointer to a surface for
642  the requested wall surface. This curve is on the heap and
643  the caller is responsible for deleting this curve.
644  */
645  ON_Surface* WallSurface( ON_COMPONENT_INDEX ci ) const;
646 
647  /*
648  Paramters:
649  line_curve - [in]
650  If null, a line curve will be allocated using new.
651  Returns:
652  Null if the extrusion path is not valid. Otherwise
653  a pointer to an ON_LineCurve that is set to the
654  extrusion's path. The caller must delete this curve.
655  */
657 
658  /*
659  Paramters:
660  profile_parameter - [in]
661  parameter on profile curve
662  Returns:
663  -1: if the profile_parameter does not correspond
664  to a point on the profile curve.
665  >= 0: index of the profile curve with domain containing
666  this paramter. When the profile_parameter corresponds
667  to the end of one profile and the beginning of the next
668  profile, the index of the next profile is returned.
669  */
670  int ProfileIndex( double profile_parameter ) const;
671 
672 
673  /*
674  Returns:
675  If m_profile_count >= 2 and m_profile is an ON_PolyCurve
676  with m_profile_count segments defining outer and inner
677  profiles, a pointer to the polycurve is returned.
678  Otherwise null is returned.
679  */
680  const ON_PolyCurve* PolyProfile() const;
681 
682  /*
683  Description:
684  Get a list of the 2d profile curves.
685  Returns:
686  Number of curves appended to the list.
687  */
688  int GetProfileCurves( ON_SimpleArray<const ON_Curve*>& profile_curves ) const;
689 
690 
691  /*
692  Description:
693  Get the parameters where a profile curve has kinks.
694  Parameters:
695  profile_index - [in]
696  profile_kink_parameters - [out]
697  parameters at internal kinks are appended to this array.
698  Returns:
699  Number of parameters appended to profile_kink_parameters[]
700  Remarks:
701  This function is used when making the brep form that has
702  smooth faces.
703  */
704  int GetProfileKinkParameters( int profile_index, ON_SimpleArray<double>& profile_kink_parameters ) const;
705 
706  /*
707  Parameters:
708  profile_index - [in]
709  Returns:
710  True if the profile has at least one kink.
711  */
712  bool ProfileIsKinked( int profile_index ) const;
713 
714  /*
715  Description:
716  Test a polycurve to determine if it meets the necessary
717  conditions to be used as a multi-segment profile in a extrusion.
718  Returns:
719  True if the returned polycurve can be used a a multi-segment
720  profile in a extrusion.
721  */
722  static bool IsValidPolyCurveProfile( const ON_PolyCurve& polycurve, ON_TextLog* text_log = 0 );
723 
724  /*
725  Description:
726  If possible, modify a polycurve so it meets the necessary conditions
727  to be used as a multi-segment profile in a extrusion.
728  Returns:
729  True if the returned polycurve can be used a a multi-segment
730  profile in a extrusion.
731  */
732  static bool CleanupPolyCurveProfile( ON_PolyCurve& polycurve );
733 
734  // path definition:
735  // The line m_path must have length > m_path_length_min.
736  // The interval m_t must statisfy 0 <= m_t[0] < m_t[1] <= 1.
737  // The extrusion starts at m_path.PointAt(m_t[0]) and ends
738  // at m_path.PointAt(m_t[1]).
739  // The "up" direction m_up is a unit vector that must
740  // be perpendicular to m_path.Tangent().
744 
745  // profile information:
746  // In general, use SetOuterProfile() and AddInnerProfile()
747  // to set m_profile_count and m_profile. If you are
748  // a glutton for punishment, then you might be interested
749  // in the following.
750  // The profile curves must be in the x-y plane.
751  // The profile's "y" axis corresponds to m_up.
752  // The point (0,0) is extruded along the m_path line.
753  // If m_profile_count = 1, then m_profile can be any
754  // type of continous curve. If m_profile_count > 1,
755  // then m_profile must be an ON_PolyCurve with
756  // m_profile_count segments, the domain of each segment
757  // must exactly match the polycurve's segment domain,
758  // every segment must be continuous and closed,
759  // the first segement curve must have counter-clockwise
760  // orientation, and the rest must have clockwise
761  // orientations.
764 
765  // capped end information:
766  // If the profile is closed, then m_bCap[] determines
767  // if the ends are capped.
768  bool m_bCap[2];
769 
770  // mitered end information:
771  // The normals m_N[] are with respect to the xy plane.
772  // A normal parallel to the z axis has no mitering.
773  // If m_bHaveN[i] is true, then m_N[i] must be a 3d unit
774  // vector with m_N[i].z > m_Nz_tol; If m_bHaveN[i]
775  // is false, then m_N[i] is ignored. The normal m_N[0]
776  // defines the start miter plane and m_N[1] defines the
777  // end miter plane.
778  bool m_bHaveN[2];
779  ON_3dVector m_N[2];
780 
781  // Surface parameterization information
783  bool m_bTransposed; // false: (s,t) = (profile,path)
784 
785  // The z coordinates of miter plane normals must be
786  // greater than m_Nz_tol
787  static const double m_Nz_min; // 1/64;
788 
789  // The length of the m_path line must be greater than
790  // m_path_length_min
791  static const double m_path_length_min; // ON_ZERO_TOLERANCE;
792 
793  /*
794  Description:
795  Get an ON_Exrusion form of a cylinder.
796  Parameters:
797  cylinder - [in] cylinder.IsFinite() must be true
798  bCapBottom - [in] if true, the end at cylinder.m_height[0] will be capped
799  bCapTop - [in] if true, the end at cylinder.m_height[1] will be capped
800  extrusion - [in]
801  If the input extrusion pointer is null, one will be allocated on the heap
802  and it is the caller's responsibility to delte it at an appropriate time.
803  If the input pointer is not null, this extrusion will be used and the same
804  pointer will be returned, provided the input is valid.
805  Returns:
806  If the input is valid, a pointer to an ON_Exrusion form of the cylinder.
807  If the input is not valid, then null, even when the input extrusion
808  object is not null.
809  Example:
810 
811  ON_Cylinder cylinder = ...;
812  bool bCapBottom = true;
813  bool bCapTop = true;
814  ON_Extrusion extrusion;
815  if ( 0 == ON_Extrusion::Cylinder(cylinder,bCapBottom,bCapTop,&extrusion) )
816  {
817  // input is not valid - nothing set
818  ...
819  }
820  else
821  {
822  // extrusion = cylinder
823  ...
824  }
825  */
827  const ON_Cylinder& cylinder,
828  bool bCapBottom,
829  bool bCapTop,
830  ON_Extrusion* extrusion = 0
831  );
832 
833  /*
834  Description:
835  Get an ON_Exrusion form of a pipe.
836  Parameters:
837  cylinder - [in] cylinder.IsFinite() must be true
838  The cylinder can be either the inner or outer wall of the pipe.
839  other_radius - [in] ( != cylinder.Radius() )
840  If cylinder.Radius() < other_radius, then the cylinder will be
841  the inside of the pipe. If cylinder.Radius() > other_radius, then
842  the cylinder will be the outside of the pipe.
843  bCapBottom - [in] if true, the end at cylinder.m_height[0] will be capped
844  bCapTop - [in] if true, the end at cylinder.m_height[1] will be capped
845  extrusion - [in]
846  If the input extrusion pointer is null, one will be allocated on the heap
847  and it is the caller's responsibility to delte it at an appropriate time.
848  If the input pointer is not null, this extrusion will be used and the same
849  pointer will be returned, provided the input is valid.
850  Returns:
851  If the input is valid, a pointer to an ON_Exrusion form of the pipe.
852  If the input is not valid, then null, even when the input extrusion
853  object is not null.
854  Example:
855 
856  ON_Cylinder cylinder = ...;
857  double other_radius = cylinder.Radius()+1.0;
858  bool bCapBottom = true;
859  bool bCapTop = true;
860  ON_Extrusion extrusion;
861  if ( 0 == ON_Extrusion::Pipe(cylinder,other_radius,bCapBottom,bCapTop,&extrusion) )
862  {
863  // input is not valid - nothing set
864  ...
865  }
866  else
867  {
868  // extrusion = pipe
869  ...
870  }
871  */
872  static ON_Extrusion* Pipe(
873  const ON_Cylinder& cylinder,
874  double other_radius,
875  bool bCapBottom,
876  bool bCapTop,
877  ON_Extrusion* extrusion = 0
878  );
879 
880  /*
881  Description:
882  Create an ON_Exrusion from a 3d curve, a plane and a height.
883  Parameters:
884  curve - [in]
885  A continuous 3d curve.
886  plane - [in]
887  If plane is null, then the plane returned by curve.IsPlanar() is used.
888  The 3d curve is projected to this plane and the result is passed to
889  ON_Extrusion::SetOuterProfile().
890  height - [in]
891  If the height > 0, the bottom of the extrusion will be in plane and
892  the top will be height units above the plane.
893  If the height < 0, the top of the extrusion will be in plane and
894  the bottom will be height units below the plane.
895  bCap - [in]
896  If the curve is closed and bCap is true, then the resulting extrusion
897  is capped.
898  extrusion - [in]
899  If the input extrusion pointer is null, one will be allocated on the heap
900  and it is the caller's responsibility to delte it at an appropriate time.
901  If the input pointer is not null, this extrusion will be used and the same
902  pointer will be returned, provided the input is valid.
903  Returns:
904  If the input is valid, a pointer to an ON_Exrusion form of the pipe.
905  If the input is not valid, then null, even when the input extrusion
906  object is not null.
907  */
909  const ON_Curve& curve,
910  const ON_Plane* plane,
911  double height,
912  bool bCap,
913  ON_Extrusion* extrusion = 0
914  );
915 
916 };
917 
918 
919 #endif
920 
ON::object_type ObjectType() const
bool GetPathPlane(double s, ON_Plane &plane) const
unsigned int SizeOf() const
ISO IsIsoparametric(const ON_BoundingBox &bbox) const
const ON_PolyCurve * PolyProfile() const
bool SetPathAndUp(ON_3dPoint A, ON_3dPoint B, ON_3dVector up)
bool GetNurbFormParameterFromSurfaceParameter(double surface_s, double surface_t, double *nurbs_s, double *nurbs_t) const
int ProfileSmoothSegmentCount(int profile_index) const
static ON_Extrusion * Cylinder(const ON_Cylinder &cylinder, bool bCapBottom, bool bCapTop, ON_Extrusion *extrusion=0)
ON_Brep * BrepForm(ON_Brep *brep=NULL) const
ON_Extrusion(const ON_Extrusion &src)
ON_Curve * m_profile
ON_3dVector PathTangent() const
void Destroy()
bool GetBrepFormComponentIndex(ON_COMPONENT_INDEX extrusion_ci, ON_COMPONENT_INDEX &brep_ci) const
ISO IsIsoparametric(const ON_Curve &curve, const ON_Interval *curve_domain=NULL) const
ON_BOOL32 GetLocalClosestPoint(const ON_3dPoint &, double, double, double *, double *, const ON_Interval *=NULL, const ON_Interval *=NULL) const
int GetNurbForm(ON_NurbsSurface &nurbs_surface, double tolerance=0.0) const
ON_BOOL32 Transform(const ON_Xform &xform)
bool ProfileIsKinked(int profile_index) const
int CapCount() const
ON_Interval m_t
bool GetNextDiscontinuity(int dir, ON::continuity c, double t0, double t1, double *t, int *hint=NULL, int *dtype=NULL, double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE, double curvature_tolerance=ON_SQRT_EPSILON) const
ON_Interval m_path_domain
int PathParameter() const
ON_BOOL32 GetParameterTolerance(int dir, double t, double *tminus, double *tplus) const
ON_BOOL32 Reverse(int dir)
ON_BOOL32 Read(ON_BinaryArchive &binary_archive)
ON_Curve * Profile3d(int profile_index, double s) const
int Degree(int dir) const
ON_BOOL32 Write(ON_BinaryArchive &binary_archive) const
void Dump(ON_TextLog &) const
ON_BOOL32 SetDomain(int dir, double t0, double t1)
int GetProfileCurves(ON_SimpleArray< const ON_Curve * > &profile_curves) const
ON_Curve * Profile3d(ON_COMPONENT_INDEX ci) const
int GetProfileKinkParameters(int profile_index, ON_SimpleArray< double > &profile_kink_parameters) const
ON_BOOL32 Transpose()
static const double m_path_length_min
int Dimension() const
ON_DEPRECATED int FaceCount() const
ON_BOOL32 IsClosed(int) const
const ON_Curve * Profile(int profile_index) const
static bool CleanupPolyCurveProfile(ON_PolyCurve &polycurve)
int IsCapped() const
ON_SumSurface * SumSurfaceForm(ON_SumSurface *sum_surface) const
ON_BOOL32 Evaluate(double u, double v, int num_der, int array_stride, double *der_array, int quadrant=0, int *hint=0) const
ON_Curve * WallEdge(ON_COMPONENT_INDEX ci) const
int HasNurbForm() const
ON_3dPoint PathStart() const
int IsMitered() const
ON_BOOL32 GetSpanVector(int dir, double *span_vector) const
bool GetTightBoundingBox(ON_BoundingBox &tight_bbox, int bGrowBox=false, const ON_Xform *xform=0) const
bool SetMiterPlaneNormal(ON_3dVector N, int end)
int ProfileCount() const
void GetMiterPlaneNormal(int end, ON_3dVector &N) const
ON_BOOL32 Split(int dir, double c, ON_Surface *&west_or_south_side, ON_Surface *&east_or_north_side) const
bool SetOuterProfile(ON_Curve *outer_profile, bool bCap)
bool IsContinuous(ON::continuity c, double s, double t, int *hint=NULL, double point_tolerance=ON_ZERO_TOLERANCE, double d1_tolerance=ON_ZERO_TOLERANCE, double d2_tolerance=ON_ZERO_TOLERANCE, double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE, double curvature_tolerance=ON_SQRT_EPSILON) const
ON_BOOL32 GetBBox(double *boxmin, double *boxmax, int bGrowBox=false) const
static bool IsValidPolyCurveProfile(const ON_PolyCurve &polycurve, ON_TextLog *text_log=0)
bool GetSurfaceParameterFromNurbFormParameter(double nurbs_s, double nurbs_t, double *surface_s, double *surface_t) const
ON_Brep * BrepForm(ON_Brep *brep, bool bSmoothFaces) const
int ProfileParameter() const
bool IsSolid() const
ON_LineCurve * PathLineCurve(ON_LineCurve *line_curve) const
ON_BOOL32 GetSurfaceSize(double *width, double *height) const
ON__UINT32 DataCRC(ON__UINT32 current_remainder) const
ON_BOOL32 Trim(int dir, const ON_Interval &domain)
ON_BOOL32 GetSpanVectorIndex(int dir, double t, int side, int *span_vector_index, ON_Interval *span_interval) const
static ON_Extrusion * Pipe(const ON_Cylinder &cylinder, double other_radius, bool bCapBottom, bool bCapTop, ON_Extrusion *extrusion=0)
ON_BOOL32 IsPlanar(ON_Plane *plane=NULL, double tolerance=ON_ZERO_TOLERANCE) const
bool SetPath(ON_3dPoint A, ON_3dPoint B)
ON_BOOL32 IsPeriodic(int) const
ON_Surface * WallSurface(ON_COMPONENT_INDEX ci) const
ON_BOOL32 IsValid(ON_TextLog *text_log=NULL) const
bool GetBrepFormComponentIndex(ON_COMPONENT_INDEX extrusion_ci, double extrusion_profile_parameter, const ON_Brep &brep_form, ON_COMPONENT_INDEX &brep_ci) const
ON_Interval Domain(int dir) const
ON_3dVector m_up
bool GetClosestPoint(const ON_3dPoint &P, double *s, double *t, double maximum_distance=0.0, const ON_Interval *sdomain=0, const ON_Interval *tdomain=0) const
static const double m_Nz_min
bool AddInnerProfile(ON_Curve *inner_profile)
bool Extend(int dir, const ON_Interval &domain)
bool GetProfileTransformation(double s, ON_Xform &xform) const
int SpanCount(int dir) const
ON_Extrusion & operator=(const ON_Extrusion &)
bool GetProfilePlane(double s, ON_Plane &plane) const
int ProfileIndex(double profile_parameter) const
static ON_Extrusion * CreateFrom3dCurve(const ON_Curve &curve, const ON_Plane *plane, double height, bool bCap, ON_Extrusion *extrusion=0)
ON_Curve * IsoCurve(int dir, double c) const
ON_3dPoint PathEnd() const
@ B
Definition: norms.h:54