MeshLib Documentation
Loading...
Searching...
No Matches
MRCylinder3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMesh/MRMeshFwd.h"
4#include "MRLine.h"
5
6namespace MR
7{
8// A class describing a cylinder as a mathematical object.A cylinder is represented by a centerline, a radius, and a length.template <typename T>
9// TODO: Cylinder3 could be infinite. For example for infinite Cylinder3 we could use negative length or length = -1
10template <typename T>
12{
13public:
15 {}
16
17 Cylinder3( const Vector3<T>& inCenter, const Vector3<T>& inDirectoin, T inRadius, T inLength )
18 :
19 mainAxis( inCenter, inDirectoin ),
20 radius( inRadius ),
21 length( inLength )
22 {}
23 Cylinder3( const Line3<T>& inAxis, T inRadius, T inLength )
24 :
25 mainAxis( inAxis ),
26 radius( inRadius ),
27 length( inLength )
28 {}
29
31 {
32 return mainAxis.p;
33 }
34
35 const Vector3<T>& center( void ) const
36 {
37 return mainAxis.p;
38 }
39
41 {
42 return mainAxis.d;
43 }
44
45 const Vector3<T>& direction( void ) const
46 {
47 return mainAxis.d;
48 }
49
51 T radius = 0;
52 T length = 0;
53};
54
55} // namespace MR
Definition MRCylinder3.h:12
T radius
Definition MRCylinder3.h:51
Cylinder3(const Vector3< T > &inCenter, const Vector3< T > &inDirectoin, T inRadius, T inLength)
Definition MRCylinder3.h:17
Cylinder3()
Definition MRCylinder3.h:14
Cylinder3(const Line3< T > &inAxis, T inRadius, T inLength)
Definition MRCylinder3.h:23
T length
Definition MRCylinder3.h:52
Line3< T > mainAxis
Definition MRCylinder3.h:50
const Vector3< T > & center(void) const
Definition MRCylinder3.h:35
Vector3< T > & direction(void)
Definition MRCylinder3.h:40
Vector3< T > & center(void)
Definition MRCylinder3.h:30
const Vector3< T > & direction(void) const
Definition MRCylinder3.h:45
Definition MRCameraOrientationPlugin.h:8
Definition MRLine.h:12
Definition MRMesh/MRVector3.h:19