I want to get a contour of mesh from a camera position and direction.
I found the meshoutline, but I can’t find a C++ function.
Does anyone know a similar function ?
/*
Description:
Creates polyline curve outlines from meshes.
Parameters:
InMeshes [in] - The meshes to outline.
view [in] - The view that provides the outline direction.
tolerance [in] - The tolerence used in the calculation (can be tiny).
OutRegions [out] - The output curves
Return:
True if successful, false otherwise.
Remarks:
THE CALLER IS RESPONSIBLE FOR DESTROYING THE OUTPUT CURVE.
*/
RHINO_SDK_FUNCTION
bool RhinoGetMeshOutline(
const ON_SimpleArray<const ON_Mesh*>& InMeshes,
const CRhinoView* view,
double tolerance,
ON_ClassArray<ON_SimpleArray<ON_PolylineCurve*>>& OutRegions
);
As you can see this is only usable with a view, not with a camera position and direction. It is, however, relatively easy to code this yourself:
Project the mesh points onto the plane defined by the camera position (plane origin) and direction (plane normal).
Transform the points from the plane to the XY-plane
Thank you very much!
I don’t know why I can’t find it through Rhino 5.0 C++ SDK Help.
The word “RhinoGetMeshOutline” can find out, but " MeshOutline" is nothing.
Let me confused.