# FAQ: Why is the A3DCrvBase\* for this A3DTopoEdge null?

**URL:** <https://forum.techsoft3d.com/t/faq-why-is-the-a3dcrvbase-for-this-a3dtopoedge-null/1463>\
**Category:** HOOPS Exchange\
**Tags:** code, knowledge-base, faq, brep\
**Created:** [December 13, 2021, 5:00am UTC](https://forum.techsoft3d.com/t/faq-why-is-the-a3dcrvbase-for-this-a3dtopoedge-null/1463 "2021-12-13T05:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)\
**Post date:** [December 13, 2021, 5:00am UTC](https://forum.techsoft3d.com/t/faq-why-is-the-a3dcrvbase-for-this-a3dtopoedge-null/1463/1 "2021-12-13T05:00:00Z")

</div>

# Introduction

As a developer using HOOPS Exchange, you would like to evaluate the exact positions and directions along the edges of a B-Rep model. While attempting to do this, you encounter `A3DTopoEdge` objects that have a null curve pointer. Why is this, and how do I evaluate edge geometry defined in this way?

# Background

HOOPS Exchange is capable of representing B-Rep data from many different source formats. Some formats define edge geometry using a parametric evaluation of the adjacent face(s) rather than a 3D curve defined by `A3DTopoEdgeData::m_pCurve`.

If this is the case, you will encounter a null 3D curve pointer, but each co-edge referencing the edge will contain a non-null `A3DTopoCoEdgeData::m_pUVCurve`. This is a 2D curve that you can use with the function `A3DCrvEvaluate` to evaluate over its valid interval. The evaluation will return a 2D vector (Z will be 0) which are parametric values to be used with the surface evaluator.

# Solution

One way to solve this problem is to use the [A3DTopoEdgeGetOrCompute3DCurve](https://docs.techsoft3d.com/exchange/latest/api/A3DSDKTopology_8h.html#_CPPv430A3DTopoEdgeGetOrCompute3DCurvePK15A3DTopoBrepDataPK11A3DTopoEdgePPK10A3DCrvBase) helper function provided by HOOPS Exchange. This function obtains the 3D curve from the edge if it exists and computes a new 3D curve if it does not. One consideration to make before using this function is that it requires a pointer to the `A3DTopoBrepData` that contains the edge.

```auto
bool evaluateEdgePosition( A3DTopoBrepData *brep_data, A3DTopoEdge *edge, double const t, A3DVector3dData &result ) {
    A3DCrvBase const *curve = nullptr;
    if( ! CheckResult( A3DTopoEdgeGetOrCompute3DCurve( brep_data, edge, &curve ) ) ) {
        return false;
    }
    
    return CheckResult( A3DCrvEvaluate( curve, t, 0, &result ) );
}

```

# Summary

The HOOPS Exchange data model can represent edge geometry in different ways depending on the input file format. Using the method described above, you can determine and reliably obtain a 3D curve for parametric evaluation.
