MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / untruncateCone

Method untruncateCone

source/MRMesh/MRFeatures.cpp:80–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80Primitives::ConeSegment Primitives::ConeSegment::untruncateCone() const
81{
82 bool isCone = !isCircle() && positiveSideRadius != negativeSideRadius;
83 assert( isCone );
84 if ( !isCone )
85 return *this; // Not a cone.
86
87 if ( positiveSideRadius == 0 || negativeSideRadius == 0 )
88 return *this; // Already truncated.
89
90 ConeSegment ret = *this;
91
92 float shift = std::min( positiveSideRadius, negativeSideRadius ) * length() / std::abs( positiveSideRadius - negativeSideRadius );
93 ( positiveSideRadius < negativeSideRadius ? ret.positiveLength : ret.negativeLength ) += shift;
94 return ret;
95}
96
97Primitives::ConeSegment Primitives::ConeSegment::axis() const
98{

Callers 2

TESTFunction · 0.80
forEachSubfeatureFunction · 0.80

Calls 3

minFunction · 0.85
absFunction · 0.85
lengthFunction · 0.70

Tested by 1

TESTFunction · 0.64