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{
13
14struct EndMillTool;
15
17MRVOXELS_API Box3f computeWorkArea( const Polyline3& toolpath, const MeshPart& tool );
18
20MRVOXELS_API Box3i computeGridBox( const Box3f& workArea, float voxelSize );
21
24{
26 const Polyline3& path;
28 MeshPart toolMesh;
32 const EndMillTool* toolSpec = nullptr;
34 // TODO: replace with tolerance and make the voxel size implementation-specific
35 float voxelSize{ 0.0f };
37 size_t memoryLimit = 0;
40};
41
45
49
52{
53public:
54 virtual ~IComputeToolDistance() = default;
55
58 virtual Expected<Vector3i> prepare( const Vector3i& dims, const Polyline3& toolpath, const EndMillTool& toolSpec ) = 0;
61 virtual Expected<Vector3i> prepare( const Vector3i& dims, const Polyline3& toolpath, const Polyline2& toolProfile ) = 0;
62
65 std::vector<float>& output,
66 const Vector3i& dims, float voxelSize, const Vector3f& origin,
67 float padding
68 ) const = 0;
69 // TODO: async
70};
71
76
77} // namespace MR
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
#define MRVOXELS_CLASS
Definition MRVoxels/MRVoxelsFwd.h:14
Interface for custom tool distance computation implementations.
Definition MRSweptVolume.h:52
virtual Expected< void > computeToolDistance(std::vector< float > &output, const Vector3i &dims, float voxelSize, const Vector3f &origin, float padding) const =0
Compute tool distance.
virtual ~IComputeToolDistance()=default
virtual Expected< Vector3i > prepare(const Vector3i &dims, const Polyline3 &toolpath, const EndMillTool &toolSpec)=0
virtual Expected< Vector3i > prepare(const Vector3i &dims, const Polyline3 &toolpath, const Polyline2 &toolProfile)=0
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:729
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:25
MRVOXELS_API Box3f computeWorkArea(const Polyline3 &toolpath, const MeshPart &tool)
Compute bounding box for swept volume for given tool and toolpath.
MRVOXELS_API Expected< Mesh > computeSweptVolumeWithCustomToolDistance(IComputeToolDistance &comp, const ComputeSweptVolumeParameters &params)
MRVOXELS_API Expected< Mesh > computeSweptVolumeWithMeshMovement(const ComputeSweptVolumeParameters &params)
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)
Parameters for computeSweptVolume* functions.
Definition MRSweptVolume.h:24
float voxelSize
voxel size for internal voxel volumes
Definition MRSweptVolume.h:35
const EndMillTool * toolSpec
Definition MRSweptVolume.h:32
const Polyline3 & path
toolpath
Definition MRSweptVolume.h:26
size_t memoryLimit
(distance volume) max memory amount used for the distance volume, zero for no limits
Definition MRSweptVolume.h:37
ProgressCallback cb
progress callback
Definition MRSweptVolume.h:39
MeshPart toolMesh
tool mesh
Definition MRSweptVolume.h:28
end mill tool specifications
Definition MREndMill.h:39