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{
11
12
14{
15 Contour3f contour;
17};
18
19[[nodiscard]] inline bool isClosed( const Contour3f& c ) { return c.size() > 1 && c.front() == c.back(); }
20
22[[nodiscard]] inline MarkedContour3f markedContour( Contour3f in )
23{
24 const auto sz = in.size();
25 return MarkedContour3f{ .contour = std::move( in ), .marks = BitSet( sz, true ) };
26}
27
29[[nodiscard]] inline MarkedContour3f markedFirstLast( Contour3f in )
30{
31 const auto sz = in.size();
32 MarkedContour3f res{ .contour = std::move( in ), .marks = BitSet( sz, false ) };
33 res.marks.set( 0 );
34 res.marks.set( sz - 1 );
35 return res;
36}
37
41[[nodiscard]] MRMESH_API MarkedContour3f resample( const MarkedContour3f & in, float minStep, Contour3f * normals = nullptr );
42
47[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, float markStability = 1, const Contour3f * normals = nullptr );
48
53[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( MarkedContour3f in, const Contour3f & normals, float markStability = 1 );
54
56{
59 float samplingStep = 1;
60
63
67 int iterations = 1;
68
70 Contour3f * normals = nullptr;
71
73 bool normalsAffectShape = false;
74};
75
78[[nodiscard]] MRMESH_API MarkedContour3f makeSpline( const Contour3f & controlPoints, const SplineSettings & settings );
79
80}
Definition MRBitSet.h:24
size_type size() const noexcept
Definition MRBitSet.h:54
MRMESH_API BitSet & set(IndexType n, size_type len, bool val)
MarkedContour3f markedContour(Contour3f in)
Definition MRMarkedContour.h:22
MRMESH_API bool isClosed(const ContinuousContour &contour)
returns true if contour is closed
float samplingStep
Definition MRMarkedContour.h:59
MRMESH_API MarkedContour3f makeSpline(MarkedContour3f in, float markStability=1, const Contour3f *normals=nullptr)
Contour3f contour
Definition MRMarkedContour.h:15
float controlStability
a positive value, the more the value the closer resulting spline will be to given control points
Definition MRMarkedContour.h:62
Contour3f * normals
optional parameter with the normals of input points that will be resampled to become normals of outpu...
Definition MRMarkedContour.h:70
MarkedContour3f markedFirstLast(Contour3f in)
Definition MRMarkedContour.h:29
MRMESH_API MarkedContour3f resample(const MarkedContour3f &in, float minStep, Contour3f *normals=nullptr)
int iterations
Definition MRMarkedContour.h:67
bool normalsAffectShape
if true and normals are provided, then the curve at marked points will try to be orthogonal to given ...
Definition MRMarkedContour.h:73
BitSet marks
indices of control (marked) points
Definition MRMarkedContour.h:16
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMarkedContour.h:14
Definition MRMarkedContour.h:56