edgeAngles | R Documentation |
Computes edge angles along a path defined by ordered surface coordinates, at a given distance (m.d) perpendicular to the path. This function works by first computing planes perpendicular to the edge using the curve.pp function. Note that said function returns planes at n-2 locations, since planes cannot be computed for the endpoints. Once these planes have been obtained, mesh edges that intersect the planes are identified with the edgesOnPlane function. To identify the location where the mesh thickness should be measured, the intersection points of these mesh edges with a sphere of radius m.d is computed using the e2sIntersect function. The intersections with the greatest distances between them (see note) are then used to measure mesh thickness, and angles are then computed using simple trigonometry.
edgeAngles(mesh, c.lms, m.d)
mesh |
A clean mesh3d object |
c.lms |
An Nx3 matrix-like object containing ordered 3D coordinates of points located on the mesh surface. |
m.d |
Measuring distance from the edge where the angle should be computed, given as a radius of sphere extending from each landmark of interest. |
CONSIDER projecting along the normal of the midpoint to a distance of actually xx mesh units?
This function may not work correctly if multiple sections of a mesh are cut by a plane (i.e. if segments from a different edge are included due to edge curvature).
Note that no checks are done to ensure measurements do not extend beyond central ridges, for example. Such checks would be relatively easy to implement (e.g. calculating signed distance of mesh surface pts to the line between the LOI and the target point where thickness will be measured)
Note that there will be some inaccuracies in angle calculations: a) the algorithm for finding local planes, which assumes edge landmarks define a circle, can be problematic at times, b) the sphere/edge intersection points will often not be on the defined plane
Note that the input points do not have to be equidistant, but unevenly spaced points can cause problems. If using non-equidistant points make sure you understand how the algorithm works.
Cornel M. Pop
edge_angles_vis3d and edge_angles_vis2d to visualize the measurement process in 3D and 2D respectively.
data(demoFlake2)
e.curve = sPathConnect(demoFlake2$lms[1:4, ], demoFlake2$mesh, path.choice="ridges")
meshVertices<-data.frame(t(demoFlake2$mesh$vb))
path.res <- pathResample(as.matrix(meshVertices[e.curve,1:3]), 30,
method="npts")
res = edgeAngles(demoFlake2$mesh, path.res, m.d=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.