SmApiIntersectors.h#

Fully qualified name: SM_API/inc/SmApiIntersectors.h

File members: SM_API/inc/SmApiIntersectors.h

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

/**********************************************************************
FILE NAME: SmApiIntersectors.h

PURPOSE:
    Contains popular, high level "C" type functions that intersect two objects.

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

#ifndef __SmApiIntersectors_H__
#define __SmApiIntersectors_H__

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

SMAPI_EXPORT SmApiStatus SmApiIntersectCurves(
    SmCurve* pCurve1,
    SmCurve* pCurve2,
    SmTArray<SmPoint3d>* p3DPoints,
    SmTArray<double>* parametersOnCurve1,
    SmTArray<double>* parametersOnCurve2
);

SMAPI_EXPORT SmApiStatus SmApiIntersectSurfaces(
    SmSurface* pSurface1,
    SmSurface* pSurface2,
    SmTArray<SmCurve*> * p3DCurves
);

SMAPI_EXPORT SmApiStatus SmApiIntersectFaces(
    SmFace* pFace1,
    SmFace* pFace2,
    SmTArray<SmCurve*> & r3DCurves,
    SmTArray<SmPoint3d> * pOpt3DPoints
);

SMAPI_EXPORT SmApiStatus SmApiIntersectBreps(
    SmBrep* pBrep1,
    SmBrep* pBrep2,
    SmTArray<SmCurve*> & rCurves3d,
    SmTArray<SmPoint3d> * pOptPoints3d
);

SMAPI_EXPORT SmApiStatus SmApiIntersectBrepWithPlane(
    SmBrep*  pBrep,
    const SmVector3d& rPlanePt,
    const SmVector3d& rPlaneNormal,
    SmTArray<SmCurve*>& rSectionCurves
);

// These three curve-intersection queries append caller-owned results on
// success. No new hits returns SM_ERR, even if the output arrays were nonempty
// on entry. On a solve, classification, copy, trim, or evaluation failure,
// return the kernel status and remove results added by this call only.
SMAPI_EXPORT SmApiStatus SmApiIntersectCurveSurface(
    SmCurve* pCurve,
    SmSurface*  pSurface,
    SmTArray<SmCurve*>& rCurves,
    SmTArray<SmPoint3d>& rPoints
);

SMAPI_EXPORT SmApiStatus SmApiIntersectCurveFace(
    SmCurve* pCurve,
    SmFace*  pFace,
    SmTArray<SmCurve*>& rCurves,
    SmTArray<SmPoint3d>& rPoints
);

SMAPI_EXPORT SmApiStatus SmApiIntersectCurveBrep(
    SmCurve* pCurve,
    SmBrep*  pBrep,
    SmTArray<SmCurve*>& rCurves,
    SmTArray<SmPoint3d>& rPoints
);

#endif