MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMarkedContour.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRBitSet.h"
5
6namespace MR
7{
8
14
15[[nodiscard]] inline bool isClosed( const Contour3f& c ) { return c.size() > 1 && c.front() == c.back(); }
16
18[[nodiscard]] inline MarkedContour3f markedContour( Contour3f in )
19{
20 const auto sz = in.size();
21 return MarkedContour3f{ .contour = std::move( in ), .marks = BitSet( sz, true ) };
22}
23
25[[nodiscard]] inline MarkedContour3f markedFirstLast( Contour3f in )
26{
27 const auto sz = in.size();
28 MarkedContour3f res{ .contour = std::move( in ), .marks = BitSet( sz, false ) };
29 res.marks.set( 0 );
30 res.marks.set( sz - 1 );
31 return res;
32}
33
37[[nodiscard]] MRMESH_API MarkedContour3f resample( const MarkedContour3f & in, float minStep, Contour3f * normals = nullptr );
38
43[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, float markStability = 1, const Contour3f * normals = nullptr );
44
49[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, const Contour3f & normals, float markStability = 1 );
50
52{
55 float samplingStep = 1;
56
59
63 int iterations = 1;
64
66 Contour3f * normals = nullptr;
67
69 bool normalsAffectShape = false;
70};
71
74[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( const Contour3f & controlPoints, const SplineSettings & settings );
75
76} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
container of bits
Definition MRMesh/MRBitSet.h:27
Definition MRCameraOrientationPlugin.h:8
class MRMESH_CLASS BitSet
Definition MRMesh/MRMeshFwd.h:139
MarkedContour3f markedContour(Contour3f in)
Definition MRMarkedContour.h:18
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:25
MRMESH_API MarkedContour3f resample(const MarkedContour3f &in, float minStep, Contour3f *normals=nullptr)
Contour3< float > Contour3f
Definition MRMesh/MRMeshFwd.h:317
Definition MRMarkedContour.h:10
Contour3f contour
Definition MRMarkedContour.h:11
BitSet marks
indices of control (marked) points
Definition MRMarkedContour.h:12
Definition MRMarkedContour.h:52
float samplingStep
Definition MRMarkedContour.h:55
float controlStability
a positive value, the more the value the closer resulting spline will be to given control points
Definition MRMarkedContour.h:58
Contour3f * normals
optional parameter with the normals of input points that will be resampled to become normals of outpu...
Definition MRMarkedContour.h:66
int iterations
Definition MRMarkedContour.h:63
bool normalsAffectShape
if true and normals are provided, then the curve at marked points will try to be orthogonal to given ...
Definition MRMarkedContour.h:69