MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMarkedContour.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRBitSet.h"
4#include "MRMeshFwd.h"
5#include "MRVector3.h"
6
7namespace MR
8{
9
15
16[[nodiscard]] inline bool isClosed( const Contour3f& c ) { return c.size() > 1 && c.front() == c.back(); }
17
19[[nodiscard]] inline MarkedContour3f markedContour( Contour3f in )
20{
21 const auto sz = in.size();
22 return MarkedContour3f{ .contour = std::move( in ), .marks = BitSet( sz, true ) };
23}
24
26[[nodiscard]] inline MarkedContour3f markedFirstLast( Contour3f in )
27{
28 const auto sz = in.size();
29 MarkedContour3f res{ .contour = std::move( in ), .marks = BitSet( sz, false ) };
30 res.marks.set( 0 );
31 res.marks.set( sz - 1 );
32 return res;
33}
34
38[[nodiscard]] MRMESH_API MarkedContour3f resample( const MarkedContour3f & in, float minStep, Contour3f * normals = nullptr );
39
44[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, float markStability = 1, const Contour3f * normals = nullptr );
45
50[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, const Contour3f & normals, float markStability = 1 );
51
53{
56 float samplingStep = 1;
57
60
64 int iterations = 1;
65
67 Contour3f * normals = nullptr;
68
70 bool normalsAffectShape = false;
71};
72
75[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( const Contour3f & controlPoints, const SplineSettings & settings );
76
77} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
Definition MRMesh/MRBitSet.h:28
Definition MRCameraOrientationPlugin.h:8
class MRMESH_CLASS BitSet
Definition MRMesh/MRMeshFwd.h:144
Contour3< float > Contour3f
Definition MRMesh/MRMeshFwd.h:375
MarkedContour3f markedContour(Contour3f in)
Definition MRMarkedContour.h:19
MRMESH_API bool isClosed(const ContinuousContour &contour)
returns true if contour is closed
MRMESH_API MarkedContour3f makeSpline(MarkedContour3f in, float markStability=1, const Contour3f *normals=nullptr)
MarkedContour3f markedFirstLast(Contour3f in)
Definition MRMarkedContour.h:26
MRMESH_API MarkedContour3f resample(const MarkedContour3f &in, float minStep, Contour3f *normals=nullptr)
Definition MRMarkedContour.h:11
Contour3f contour
Definition MRMarkedContour.h:12
BitSet marks
indices of control (marked) points
Definition MRMarkedContour.h:13
Definition MRMarkedContour.h:53
float samplingStep
Definition MRMarkedContour.h:56
float controlStability
a positive value, the more the value the closer resulting spline will be to given control points
Definition MRMarkedContour.h:59
Contour3f * normals
optional parameter with the normals of input points that will be resampled to become normals of outpu...
Definition MRMarkedContour.h:67
int iterations
Definition MRMarkedContour.h:64
bool normalsAffectShape
if true and normals are provided, then the curve at marked points will try to be orthogonal to given ...
Definition MRMarkedContour.h:70