MeshLib
 
Loading...
Searching...
No Matches
MRPolyline2Intersect.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRId.h"
4#include "MREdgePoint.h"
5#include <cfloat>
6#include <optional>
7
8namespace MR
9{
12
18[[nodiscard]] MRMESH_API bool isPointInsidePolyline( const Polyline2& polyline, const Vector2f& point );
19
21
22struct [[nodiscard]] PolylineIntersectionResult2
23{
27 float distanceAlongLine = 0;
28};
29
34[[nodiscard]] MRMESH_API std::optional<PolylineIntersectionResult2> rayPolylineIntersect( const Polyline2& polyline, const Line2f& line,
35 float rayStart = 0, float rayEnd = FLT_MAX, const IntersectionPrecomputes2<float>* prec = nullptr, bool closestIntersect = true );
36
41[[nodiscard]] MRMESH_API std::optional<PolylineIntersectionResult2> rayPolylineIntersect( const Polyline2& polyline, const Line2d& line,
42 double rayStart = 0, double rayEnd = DBL_MAX, const IntersectionPrecomputes2<double>* prec = nullptr, bool closestIntersect = true );
43
44} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API bool isPointInsidePolyline(const Polyline2 &polyline, const Vector2f &point)
detect if given point is inside polyline, by counting ray intersections
Definition MRCameraOrientationPlugin.h:7
MRMESH_API std::optional< PolylineIntersectionResult2 > rayPolylineIntersect(const Polyline2 &polyline, const Line2f &line, float rayStart=0, float rayEnd=FLT_MAX, const IntersectionPrecomputes2< float > *prec=nullptr, bool closestIntersect=true)
encodes a point on an edge of mesh or of polyline
Definition MREdgePoint.h:11
Definition MRMesh/MRMeshFwd.h:494
Definition MRPolyline2Intersect.h:23
EdgePoint edgePoint
intersection point in polyline
Definition MRPolyline2Intersect.h:25