DG Kernel Documentation

Skip Navigation Links.
Skip Navigation LinksHome Page > API Reference > Model > Operations and Agorithms > IDiffSurface_KC Search Documentation

IDiffSurface_KC Interface


IDiffSurface_KC interface returns normal vector to surface of the object the interface was queried from. The interface can be queried from ISection. Not all types of entities implement this interface. Mesh entities do implement it.

See also: Interface List

HRESULT GetNormalAt(DIPoint* pointAt, DIPoint* normal, int *count)


pointAt - [in] Point where the normal to be calculated

normal - [out] Calculated normal to the surface at point pointAt

count - [out, retval] Count of normals at the point. Value of 0 means an error.


The method calculates normal at point on surface of the object this interface was queried from. When pointAt is not located exactly on the surface a nearest point is calculated and normal at the point is returned. See also comments for the next method.

The method is  a simplified version of the GetProximity method below for a case when it is known that the surface is smooth at the point and has a single normal. It is recommended to verify this assumption by checking the returned count value.

The returned count number indicates how many normals the surface has at the point. When point belong to a smooth surface patch the count is 1. When the point is located on a smooth edge the count is 2. When the point is located at a corner count will be equal to number of smooth patches joined at the corner. Value of 0 means an error.

The normal contains only the first normal.at the point.

HRESULT GetProximity(DIPoint* pointAt, IVertex** vertex)


pointAt - [in] Point where the normal to be calculated

vertex - [out, retval] The returned vertex, which contains array of all normals at the point


See also remark for the previous method. This method contains full information about normals at the point. Use methods of IVertex to access array of normals.

In case when pointAt is not located exactly on the surface coordinates returned by IVertex.GetVertexCoord are coordinates of the nearest point on the surface. This can be used to verify that pointAt is close to the surface.

HRESULT GetLocalParametrization(DIPoint* pointAt, IKO_Geom_BSplineSurface** patch)


pointAt - [in] Center of approximation

patch - [out, retval] The returned BSpline patch which approximates the surface


Returns a BSpline patch which approximates the surface around pointAt. If this interface was queried from a entity, which is part of a model, a new entity geometry of which is the returned patch will be added to the model as the last top-level object. This object can be deleted if no representation in the scene is required. The patch in this case is still a valid usable object.