Synopsis
PDX_MSGT gdx_ExtractSubSurface(long option, MDA_PTR gdx_surface_ptr, int model, double u0, double u1, double v0, double v1, double approx_tol, int *parm_chg_flg, MDA_PTR *gdx_sub_surf_ptr)
Purpose
Extract a subsurface from a GDX Surface entity
Description
Given a GDX surface and extraction parameters, extract the corresponding sub-surface.
The sense of the subsurface (in both parameters) will be the same as the original surface. The parameterization of the sub-surface might change. By definition, parameterization has not changed if and only if the evaluation of points on the original surface and sub-surface yield identical results for every ( u, v ) point in the domain of the sub-surface. The parm_chg_flg argument will indicate whether or not the parameterization of the sub-surface is different from that of the original surface. This flag can be used to determine whether parameter values or parameter space curves associated to the original surface are still valid.
The extracted GDX surface type is consistent with the original surface. For analytical surfaces Cone, Torus, Sphere, and Cylinder, however the extracted surface will be of type GDX_REV_SURF.
The extraction will fail if the specified parameters do not represent a valid portion within the original surface extending from low parameter to the high parameter. If the original surface is closed in one parameter, a portion passed over the seam for the that parameter could be acceptable.
Input
option
GDX_LEAVE_LOCKED
If set, the returned entity will be left locked; in this case it is up to the caller to call mda_UnlockEntity for each entity returned. Note: the entity structure can be accessed via mda_GetLockedAddr.
gdx_surface_ptr
The GDX Surface entity database pointer.
model
The model in which to create the subsurface GDX Surface entity.
u0
The u-directional extraction start parameter.
u1
The u-directional extraction end parameter. If u0 > u1, then the surface must be closed in the u-direction, and the resulting subsurface will include the u-seam (and portions of the surface to either side of the u-seam).
v0
The v-directional extraction start parameter.
v1
The v-directional extraction end parameter. If v0 > v1, then the surface must be closed in the v-direction, and the resulting subsurface will include the v-seam (and portions of the surface to either side of the v-seam).
approx_tol
Approximation tolerance in case the extraction is not precise. If ruled surface is trimmed in the v (linear) direction, then the boundary (new rail) curve(s) representing this trimming may not be precisely representable with any GDX entity type. Hence, approximation is required. The extracted ruled subsurface (S2(u,v)) should not deviate from the corresponding portion of the original surface (S1(u,v)) by more than approx_tol. That is, the projection distance from any point on S2(u,v) to S1(u,v) (or the reverse) should not exceed approx_tol. This tolerance corresponds to those in other GDX functions which do any type of curve/surface approximation. There is no corresponding gdx_tolerance; however approx_tol = 10 or 100 times MODEL_SPACE_PNT_TOL is a reasonable setting.
Output
parm_chg_flg
Flag indicating whether or not parameterization has changed. .nf = PDX_FALSE : parameterization has not changed = PDX_TRUE : parameterization has changed .fi
gdx_sub_surf_ptr
The GDX Surface database pointer of the extracted subsurface.
Tolerances
MODEL_SPACE_PNT_TOL
.fi
Return
GDX_NOERR
GDX_BADDATA
Low level error return
.fi