Geometric Modeler |
Topology |
Scanning an Edge CurveHow to Use the CATEdgeCurveIterator Operator |
Use Case |
AbstractBetween the topology and the geometry, there are intermediate objects that are used by the geometric modeler to group objects with similar function. Such objects are created to join various pieces of geometry before covering them by topology. Given two faces with a common edge, the edge curve is the object which is built from the two Pcurves defining the common side. The CATEdge topological object is then created from this edge curve. In short, this is the way an edge (a topological object) is constructed from the geometry. In this use case, no edge and no topology is created, this is the opposite which is done. From the topology (an edge), the underlying geometry is retrieved and analyzed. |
This use case is intended to make you understand how an edge curve is constructed and how to use the CATEdgeCurveIterator operator to scan an edge curve.
An edge curve is an aggregation of several curves. The curves aggregated are the curves which define the boundaries of the adjacent faces. They can be of various type: CATPNurbs, CATLine or even CATEdgeCurve. Among the aggregated curves, there is one which is used as a reference to determine the orientation of the edge curve and if needed reparameterize the other curve, this is the "ref curve".
EDGE CURVE ORIENTATION / “REF CURVE” ORIENTATION = 1
The "ref curve" is:
There are three kinds of edge curve:
To manipulate an edge curve, you must:
|
![]() |
[Top]
CAATopEdgeCurve is a use case of the CAATopologicalObjects.edu framework that illustrates the NewTopologicalObjects framework capabilities.
[Top]
The CAATopEdgeCurve use case:
[Top]
To launch CAATopEdgeCurve , you will need to set up the build time environment, then compile CAATopEdgeCurve.m along with its prerequisites, set up the run time environment, and then execute the use case [1].
With Windows CAATopEdgeCurve e:\edgeCurve1.NCGM
With UNIX
CAATopEdgeCurve
/u/
edgeCurve1.NCGM
where
edgeCurve1
.NCGM is
an input file delivered in the CAATopologicalObjects.edu/FunctionTests/InputData
file.
[Top]
The CAATopEdgeCurve use case is made of a main named CAAEdgeCurve.cpp located in the CAATopEdgeCurve.m module of the CAATopologicalObjects.edu framework:
Windows | InstallRootDirectory\CAATopologicalObjects.edu\CAATopEdgeCurve.m\ |
Unix | InstallRootDirectory/CAATopologicalObjects.edu/CAATopEdgeCurve.m/ |
where InstallRootDirectory
is the directory where the CAA
CD-ROM is installed.
[Top]
There are three main steps in CAATopEdgeCurve.cpp:
[Top]
The geometry factory (CATGeoFactory) creates and manages all the
CATICGMObject (and the curves and surfaces in particular). In this use case,
the factory is defined by reading a NCGM file that was previously stored,
the global function ::CATLoadCGMContainer
must be used to retrieve
the factory. The edge is retrieved by using the CATICGMContainer::FindObjectFromTag method.
1857 is the edge tag.
CATGeoFactory* piGeomFactory = CATLoadCGMContainer(filetoread);... CATICGMObject * piCGMObj1 = piGeomFactory->FindObjectFromTag( 1857 ); |
[Top]
There are three steps:
// (a) - retrieve the edge curve from the edge ... CATEdgeCurve * pEdgeCurve = piEdge->GetCurve(&OriECrvVsEdge ); // // (b) - retrieve the "ref curve" // CATCurve * RefCurve = pEdgeCurve->GetRefCurve(); ... // // (c) - scans the edge curve // In this particular case, the scanned edge curve embeddes // two edge curves. // !----------- Simcurve 393 // ! !--------- PLine 385 // ! !--------- PLine 386 // !----------- Intcurve 1843 // ! !--------- PLine 1841 // ! !--------- PLine 1842 // SetLeafScan(1) returns the four PLines. // 385 // 386 // 1841 // 1842 // SetLeafScan(0) returns all the curves (the edge curve itself + sub edge curves + Pcurves). // 1858 // 393 // 385 // 386 // 1843 // 1841 // 1842 ... CATEdgeCurveIterator Iterator(pEdgeCurve); // create the iterator Iterator.SetLeafScan(0); Iterator.SetRepetitions(0); ... |
[Top]
To save the model in a file, the ::CATSaveCGMContainer
global
function is used. Notice that in the use case, the save is conditioned by an
input parameter representing the file inside which the model must be saved.
The use case ends with the closure of the geometry factory, done by the ::CATCloseCGMContainer
global function.
if(1==toStore) { #ifdef _WINDOWS_SOURCE ofstream filetowrite(pfileName, ios::binary ) ; #else ofstream filetowrite(pfileName,ios::out,filebuf::openprot) ; #endif ::CATSaveCGMContainer(piGeomFactory,filetowrite); filetowrite.close(); } // // Close the container // ::CATCloseCGMContainer(piGeomFactory); |
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Jan 200 9 ] | Document created |
[Top] |
Copyright © 200 9 , Dassault Systèmes. All rights reserved.