3.27 cppol2d – Polygon deep copy¶
The cppol2d routine creates a deep copy of a polygon’s geometric and topological structure. It duplicates both the connectivity information (vertex indices) and the vertex coordinates, ensuring that the resulting polygon is an independent data structure from the original.
Fortran:
call cppol2d(ipv0,ipv,ntp0,ntp,ntv0,ntv,vertp0,vertp)
C:
cppol2d(ipv0,ipv,&ntp0,&ntp,&ntv0,&ntv,vertp0,vertp);
Python:
(ipv, ntp, ntv, vertp) = voft.cppol2d(ipv0, ntp0, ntv0, vertp0)
Arguments:
|
|
|
array of length \(\texttt{nv}\) storing the vertex indices defining the copied polygon |
|
|
|
array of length \(\texttt{nv}\) storing the vertex indices defining the original polygon |
|
|
|
maximum vertex index in the connectivity list of the copied polygon |
|
|
|
maximum vertex index in the connectivity list of the original polygon |
|
|
|
total number of vertices in the copied polygon |
|
|
|
total number of vertices in the original polygon |
|
|
|
array of dimensions \(({nv},2)\) storing the \(x,y\)-coordinates of each vertex of the copied polygon |
|
|
|
array of dimensions \(({nv},2)\) storing the \(x,y\)-coordinates of each vertex of the original polygon |
Note: In the calls shown above, the source polygon is specified by the arguments with suffix 0. The routine copies the first ntv0 connectivity entries and the coordinates of the vertices referenced by those entries. Vertex numbering is preserved, and the values of ntp0 and ntv0 are copied to ntp and ntv. Other output array entries are not defined by the routine. Fortran and C callers must provide separate storage for the source and destination arrays.