SmApiSurfaces.h#

Fully qualified name: SM_API/inc/SmApiSurfaces.h

File members: SM_API/inc/SmApiSurfaces.h

// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

/**********************************************************************
FILE NAME: SmSurfaces.h

PURPOSE:
    Contains popular, high level "C" type functions that create
    primitive objects (cube, sphere, etc).

GENERAL NOTES:
    High level functions may assume some input parameters
    for ease of use. For maximum flexibility, related functions
    can be found in SmPrimitiveCreation
**********************************************************************/

#ifndef __SmApiSurfaces_H__
#define __SmApiSurfaces_H__

#ifndef __SmApiTypes_H__
#include <SmApiTypes.h>
#endif

#include <SmTArray.h>

class SmContext;
class SmBrep;
class SmPlane;
class SmCylinder;
class SmCone;
class SmVector3d;

SMAPI_EXPORT SmApiStatus SmApiCreateSurface(
    const SmTArray<SmPoint3d> & rControlPoints,
    ULONG lNumRows,
    ULONG lNumColumns,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSurfaceFromCornerPoints(
    const SmPoint3d& crCornerUminVmin,
    const SmPoint3d& crCornerUmaxVmin,
    const SmPoint3d& crCornerUminVmax,
    const SmPoint3d& crCornerUmaxVmax,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSurfaceFromOrderedPoints(
    const SmTArray<SmPoint3d> & rPoints,
    ULONG lNumRows,
    ULONG lNumColumns,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSurfaceFromRandomPoints(
    const SmTArray<SmPoint3d> & rPoints,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateExtrude(
    SmBSplineCurve*  pCurve,
    const SmVector3d & rSweepVector,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSweep(
    SmBSplineCurve*  pCurve,
    SmBSplineCurve*  pPath,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateRuledSurface(
    SmBSplineCurve* rCurve1,
    SmBSplineCurve* rCurve2,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSurfaceRevolution(
    SmBSplineCurve* rCurve,
    const SmPoint3d& rOrigin,
    const SmVector3d& rAxisDir,
    double dAngleDeg,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateSkin(
    const SmTArray<SmBSplineCurve*>& rProfiles,
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiCreateOffsetSurface(
    SmSurface* pSrfToOffset,
    double dOffsetDistance,
                                            //                           negative: opp normal dir of input surface )    <br>
    SmSurface*&  rpResult
);

SMAPI_EXPORT SmApiStatus SmApiEvaluateSurfacePoint(
    const SmSurface* pSurface,
    const SmVector2d& crUV,
    SmVector3d& crPoint
);

SMAPI_EXPORT SmApiStatus SmApiEvaluateSurfaceNormal(
    const SmSurface* pSurface,
    const SmVector2d& crUV,
    SmVector3d& crNormal
);

SMAPI_EXPORT SmApiStatus SmApiEvaluateSurfaceDerivatives(
    const SmSurface* pSurface,
    const SmVector2d& crUV,
    SmVector3d& crPoint,
    SmVector3d& rDU,
    SmVector3d& rDV
);

#endif