32bool projectFaceAttribute(
const MeshPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
49 return BitSetParallelFor( mp.mesh.topology.getVertIds( mp.region ), [&] ( VertId
id )
51 auto point = !params.xfs.rigidXfPoint ? mp.mesh.points[id] : ( *params.xfs.rigidXfPoint )( mp.mesh.points[id] );
52 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
53 auto res = projectionResult.mtp;
54 VertId v1 = oldMesh.topology.org( res.e );
55 VertId v2 = oldMesh.topology.dest( res.e );
56 VertId v3 = oldMesh.topology.dest( oldMesh.topology.next( res.e ) );
57 func( id, projectionResult, v1, v2, v3 );
65 return BitSetParallelFor( mp.mesh.topology.getFaceIds( mp.region ), [&] ( FaceId newFaceId )
67 auto point = !params.xfs.rigidXfPoint ? mp.mesh.triCenter( newFaceId ) : ( *params.xfs.rigidXfPoint )( mp.mesh.triCenter( newFaceId ) );
68 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
69 func( newFaceId, projectionResult );
auto BitSetParallelFor(const BS &bs, F &&f, Cb &&... cb)
Definition MRBitSetParallelFor.h:154
MeshProjectionTransforms xfs
Definition MRProjectionMeshAttribute.h:20
tl::expected< T, E > Expected
Definition MRExpected.h:31
MRMESH_API Expected< void > projectObjectMeshData(const ObjectMeshData &oldMeshData, ObjectMeshData &newMeshData, const FaceBitSet *region=nullptr, const ProjectAttributeParams ¶ms={})
finds attributes of new mesh by projecting faces/vertices on old mesh
bool projectVertAttribute(const MeshVertPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:47
ProgressCallback progressCb
Definition MRProjectionMeshAttribute.h:21
bool projectFaceAttribute(const MeshPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:63
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
mesh and its per-element attributes for ObjectMeshHolder
Definition MRObjectMeshData.h:17
this structure contains transformation for projection from one mesh to another and progress callback
Definition MRProjectionMeshAttribute.h:19