The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)

HowTo:Determine if two VERTEXs are positionally equivalent?

From DocR19

Jump to: navigation, search

Access the actual positions under the VERTEXs and compare using same_point. Care must be taken if either of the VERTEXs are tolerant.

Contents

Signature

// Tolerance aware
logical same_point(SPAposition const&p1, SPAposition const&p2, const double res = SPAresabs);
 
// Simple 3D point comparison.
logical operator==(SPAposition const &p1, SPAposition const &p2);
logical operator!=(SPAposition const &p1, SPAposition const &p2);

Header Files

#include "position.hxx"

Example

SPAposition pos1 = ed1->start_pos();
SPAposition pos2 = ed2->start_pos();
if ( pos1 == pos2 )
   cout << "simple test, not tolerance aware!" << endl;
 
double pos1_tol = ed1->start()->get_curr_tolerance(); // Retrieve real vertex tolerance.
double pos2_tol = ed2->start()->get_curr_tolerance(); 
double work_tol = pos1_tol + pos2_tol; // OR pos1_tol > pos2_tol ? pos1_tol : pos2_tol. OR user chosen tolerance!
 
if ( same_point( pos1, pos2, work_tol ) )
   cout << "3D test with tolerance awareness" << endl;

Scheme Commands

No Scheme command.

Notes

Related Content

See also: :Category:FAQs and HowTo:Determine if two points are the same?
Personal tools