Hi Guys,
Need to find out the project point on mesh element.
using the below function i am getting wrong output.
mdlProject_perpendicular(&ProjectPt,NULL,NULL,MeshElmDescr,MASTERFILE,Pointtoproject,NULL,0.00);
How to get project point on mesh element ?
mdlProject_perpendicular projects point on wire frame of geometry. Is that expected result?
BTW, why not use mdlMesh_newPolyfaceFromXYTriangulation to create mesh ??
Answer Verified By: Daniel Christopher
Unknown said:.x = 2.2620409983992711e-111.y = 71045882.188718617.z = 281890399
Those numbers changed. .x is close to zero; .y and .z might be OK. That point is certainly closer than Alpha Centauri (remember that those are UORs, not master units). You're still passing 0.0 for Tolerance, which may be asking a lot of the algorithms.
Regards, Jon Summers LA Solutions
RotMatrix rotmatrix;
mdlRMatrix_getIdentity(&rotmatrix);
mdlRMatrix_fromNormalVector(&rotmatrix,&ElmVer[j]);
Status = mdlProject_perpendicular(&ProjectPt,NULL,NULL,MeshElmDescr,MASTERFILE,&ElmVer[j],&rotmatrix,0.00);
mdb> Status32768
mdb> ProjectPt.x = 2.2620409983992711e-111.y = 71045882.188718617.z = 281890399
Unknown said:mdlProject_perpendicular(... ,NULL, ...);
You're passing NULL for the rotation matrix. The documentation doesn't comment whether NULL is valid here. Try substituting an identity matrix...
RotMatrix rotation; mdlRMatrix_getIdentity (&rotation); ... int status = mdlProject_perpendicular(... ,&rotation, ...);
Unknown said:Status Value = 32768
Unfortunately, that's a catch-all error code, defined in <bentley.h>...
typedef enum BentleyStatus { SUCCESS = 0, BSISUCCESS = 0, ERROR = 0x8000, BSIERROR = 0x8000, } BentleyStatus;It tells us 'something went wrong', which we already know.
Hi Jon,
Status Value = 32768
Unknown said:int status = non zero ---- error
And what is that status value? Sometimes the error values are helpful. There's no reason to keep it a secret, is there?
Generated mesh in this process.
mdlSelect_addElement(PointFilepos,MASTERFILE,&PointElm,TRUE); /// Adding the required points to selection.
mdlInput_sendSynchronizedKeyin("FACET TRIANGULATE XYPOINTS;Selview 1", 0, 0, ustnTaskId); ///// by using this keyin generating the mesh.
int status = non zero ---- error.
int status = mdlProject_perpendicular (...);
mdb> status
Unknown said: .x = 8.0e-078 .y = -5.1e+120 .z = 2.0e-312
.x = 8.0e-078 .y = -5.1e+120 .z = 2.0e-312
Hmmm. It does seem unlikely that the projected point is several light years from the mesh 8-)
You're passing a tolerance of zero. I don't know if that might cause problems in the algorithms involved. Try passing a non-zero value, such as 1 UOR... const double Tolerance = 1.0;int status = mdlProject_perpendicular (..., Tolerance);