MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSweptVolume.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
4
5#include "MRMesh/MRExpected.h"
6#include "MRMesh/MRMeshPart.h"
7#include "MRMesh/MRPolyline.h"
8
9#include <vector>
10
11namespace MR
12{
15
16
17struct EndMillTool;
18
20MRVOXELS_API Box3f computeWorkArea( const Polyline3& toolpath, const MeshPart& tool );
21
23MRVOXELS_API Box3i computeGridBox( const Box3f& workArea, float voxelSize );
24
27{
29 const Polyline3& path;
31 MeshPart toolMesh;
35 const EndMillTool* toolSpec = nullptr;
38 float voxelSize{ 0.0f };
40 size_t memoryLimit = 0;
42 ProgressCallback cb;
43};
44
48
52
54class MRVOXELS_CLASS IComputeToolDistance
55{
56public:
57 virtual ~IComputeToolDistance() = default;
58
61 virtual Expected<Vector3i> prepare( const Vector3i& dims, const Polyline3& toolpath, const EndMillTool& toolSpec ) = 0;
64 virtual Expected<Vector3i> prepare( const Vector3i& dims, const Polyline3& toolpath, const Polyline2& toolProfile ) = 0;
65
68 std::vector<float>& output,
69 const Vector3i& dims, float voxelSize, const Vector3f& origin,
70 float padding
71 ) const = 0;
73};
74
79
80}
Interface for custom tool distance computation implementations.
Definition MRSweptVolume.h:55
virtual Expected< void > computeToolDistance(std::vector< float > &output, const Vector3i &dims, float voxelSize, const Vector3f &origin, float padding) const =0
Compute tool distance.
float voxelSize
Definition MRSweptVolume.h:38
const EndMillTool * toolSpec
Definition MRSweptVolume.h:35
virtual ~IComputeToolDistance()=default
const Polyline3 & path
toolpath
Definition MRSweptVolume.h:29
size_t memoryLimit
(distance volume) max memory amount used for the distance volume, zero for no limits
Definition MRSweptVolume.h:40
tl::expected< T, E > Expected
Definition MRExpected.h:31
ProgressCallback cb
progress callback
Definition MRSweptVolume.h:42
MRVOXELS_API Box3f computeWorkArea(const Polyline3 &toolpath, const MeshPart &tool)
Compute bounding box for swept volume for given tool and toolpath.
virtual Expected< Vector3i > prepare(const Vector3i &dims, const Polyline3 &toolpath, const EndMillTool &toolSpec)=0
MeshPart toolMesh
tool mesh
Definition MRSweptVolume.h:31
MRVOXELS_API Expected< Mesh > computeSweptVolumeWithCustomToolDistance(IComputeToolDistance &comp, const ComputeSweptVolumeParameters &params)
MRVOXELS_API Expected< Mesh > computeSweptVolumeWithMeshMovement(const ComputeSweptVolumeParameters &params)
virtual Expected< Vector3i > prepare(const Vector3i &dims, const Polyline3 &toolpath, const Polyline2 &toolProfile)=0
MRVOXELS_API Box3i computeGridBox(const Box3f &workArea, float voxelSize)
Compute required voxel volume's dimensions for given work area.
MRVOXELS_API Expected< Mesh > computeSweptVolumeWithDistanceVolume(const ComputeSweptVolumeParameters &params)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Parameters for computeSweptVolume* functions.
Definition MRSweptVolume.h:27
end mill tool specifications
Definition MREndMill.h:42