-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Test a few points on a square face and edge. Signed-off-by: Aiden Woodruff <[email protected]>
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <apf.h> | ||
#include <apfCAP.h> | ||
#include <gmi_cap.h> | ||
#include <lionPrint.h> | ||
#include <pcu_util.h> | ||
#include <CapstoneModule.h> | ||
#include <PCU.h> | ||
|
||
int main (int argc, char* argv[]) { | ||
MPI_Init(&argc, &argv); | ||
PCU_Comm_Init(); | ||
lion_set_verbosity(1); | ||
gmi_register_cap(); | ||
|
||
PCU_ALWAYS_ASSERT(argc == 2); | ||
std::string creFile(argv[1]); | ||
// 1. Load model. | ||
CapstoneModule cs("cap_inClosureOf", "Geometry Database : SMLIB", | ||
"Mesh Database : Create", "Attribution Database : Create"); | ||
cs.load_files(v_string(1, creFile)); | ||
// 2. CreateMesh. | ||
apf::Mesh2* m = apf::createMesh(cs.get_mesh(), cs.get_geometry()); | ||
|
||
PCU_ALWAYS_ASSERT(m->canGetClosestPoint()); | ||
|
||
apf::ModelEntity* face = m->findModelEntity(2, 1); | ||
apf::Vector3 from(0.3, 0.4, -0.8), to, p; | ||
m->getClosestPoint(face, from, to, p); | ||
PCU_ALWAYS_ASSERT((to - apf::Vector3(0.3, 0.4, -0.5)).getLength() < 0.0001); | ||
|
||
apf::ModelEntity* edge = m->findModelEntity(1, 1); | ||
from = apf::Vector3(0.6, 0.34, 0.6); | ||
m->getClosestPoint(edge, from, to, p); | ||
PCU_ALWAYS_ASSERT((to - apf::Vector3(0.5, 0.34, 0.5)).getLength() < 0.0001); | ||
|
||
apf::destroyMesh(m); | ||
PCU_Comm_Free(); | ||
MPI_Finalize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters